CORS策略Zoho会议api集成时react应用程序出错



我一直在尝试将zoho会议与我的应用程序集成(React是前端,django是后端(。

在获取访问令牌时,我收到以下错误。

Access to fetch at 'https://accounts.zoho.com/oauth/v2/token?code=1000.53axxxxxxxxxxxxxxxxxxxxxxxxxx2e8e5eb43cfe53005f8d93490&client_id=1000.PGPL8RK7R54UR7JSNKTM2ZRETSF4CI&client_secret=xxxxxxxxxxxxxxxxxxx&redirect_uri=http://localhost:3000/app_store/zoho_meet&grant_type=authorization_code' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

这是我的axios代码部分`

headers: {
'Content-Type': 'application/x-www-form-urlencoded', 
'Accept': 'application/json',
"Access-Control-Allow-Origin": "*",
} 
})
const url = `https://accounts.zoho.com/oauth/v2/token?code=${zcode}&client_id=1000.xxxxxxxxxxxxxxxI&client_secret=92821f12d14cf11162891xxxxxxxxxxxxxxxxxxxx&redirect_uri=http://localhost:3000/app_store/zoho_meet&grant_type=authorization_code`
publicAxios.get(url)
.then((res)=>{
console.log(res)
})
.catch((err)=>{
console.log(err)
})

`这里有人能帮我吗我错过了哪些步骤

我能够使用Netlify的无服务器功能从我的React应用程序连接到Zoho API。(AWS Lambda在发动机罩下起作用(我通过无服务器功能进行所有Api调用。在浏览器(客户端(中运行时,Api对Zoho的调用失败,出现CORS错误。它必须在服务器上运行。一个人也可以使用谷歌的功能,但我还没有尝试过。Netlify文档非常棒。