为什么 strapi 使用 cloudinary 作为云存储不 return 图像 link onteh api 调用
why strapi using cloudinary as a cloud storage does not return images link onteh api calls
我使 strapi+cloudinary 集成有效,但是当我尝试调用 strapi api (/api/posts) 时,图像属性没有出现在 json 文件中,出于某种原因,媒体 starpi 属性在请求中被隐藏(或者那里有一些错误)。
//api/posts
{"data":
[{
"id":1,
"attributes":
{
"title":"li fogo na bran bran ya",
"slug":"li-fogo-na-bran-bran-ya",
"conteudo":"\n\nWhat is Lorem Ipsum?\nLorem Ipsum is simply dummy text of the ...(injected humour and the like).\n\n",
"lingua":"en",
"imageName":"coyas",
"createdAt":"2022-03-19T11:16:27.549Z",
"updatedAt":"2022-03-19T11:16:35.170Z",
"publishedAt":"2022-03-19T11:16:35.166Z"}}],
"meta":{"pagination":
{
"page":1,
"pageSize":25,
"pageCount":1,
"total":1
}}}
// so where is the imagem field
与 strapi 的整合工作正常
module.exports = ({ env }) => ({
upload: {
config: {
provider: "cloudinary",
providerOptions: {
cloud_name: env("CLOUDINARY_NAME"),
api_key: env("CLOUDINARY_KEY"),
api_secret: env("CLOUDINARY_SECRET"),
},
actionOptions: {
upload: {},
delete: {},
},
},
},
我正在使用@strapi/provider-upload-cloudinary 进行存储上传
我需要做什么才能获得这些隐藏属性?
您是否尝试过将 api 端点更改为“/api/posts?populate=*”?我相信您必须明确告诉 Strapi 填充关系等,以便通过 api 调用返回它们。
我使 strapi+cloudinary 集成有效,但是当我尝试调用 strapi api (/api/posts) 时,图像属性没有出现在 json 文件中,出于某种原因,媒体 starpi 属性在请求中被隐藏(或者那里有一些错误)。
//api/posts
{"data":
[{
"id":1,
"attributes":
{
"title":"li fogo na bran bran ya",
"slug":"li-fogo-na-bran-bran-ya",
"conteudo":"\n\nWhat is Lorem Ipsum?\nLorem Ipsum is simply dummy text of the ...(injected humour and the like).\n\n",
"lingua":"en",
"imageName":"coyas",
"createdAt":"2022-03-19T11:16:27.549Z",
"updatedAt":"2022-03-19T11:16:35.170Z",
"publishedAt":"2022-03-19T11:16:35.166Z"}}],
"meta":{"pagination":
{
"page":1,
"pageSize":25,
"pageCount":1,
"total":1
}}}
// so where is the imagem field
与 strapi 的整合工作正常
module.exports = ({ env }) => ({
upload: {
config: {
provider: "cloudinary",
providerOptions: {
cloud_name: env("CLOUDINARY_NAME"),
api_key: env("CLOUDINARY_KEY"),
api_secret: env("CLOUDINARY_SECRET"),
},
actionOptions: {
upload: {},
delete: {},
},
},
},
我正在使用@strapi/provider-upload-cloudinary 进行存储上传
我需要做什么才能获得这些隐藏属性?
您是否尝试过将 api 端点更改为“/api/posts?populate=*”?我相信您必须明确告诉 Strapi 填充关系等,以便通过 api 调用返回它们。