找不到用于 Dropbox 登录的图像 window
Images not found for Dropbox login window
我一直在将 Dropbox API 和 Dropbox Chooser 实现到 React 应用程序中。当我为登录页面调用 'oauth2/authorize' 时,我收到正确的 HTML,但是当我加载它时,我收到所有有助于设置样式的图像文件的 404 错误。我附上了一张截图来显示错误的样子。知道为什么会发生这种情况或如何解决它吗?
来电:
公理({
方法:'get',
url: 'https://www.dropbox.com/oauth2/authorize?client_id=' + APP_KEY + '&response_type=code',
headers:{
'Content-Type' : 'application/json' ,
'Authorization':授权
}
}).then(函数 (res) {
让 pretty = stringifyObject(res.data, {
单引号:假
});
response.send(pretty);
})
.catch(function (error) {
response.send(error.response.data);
});
抓取:
fetch(URL + '/api/login', {method: "GET"})
.then((res)=>{ return res.text() })
.then((text)=>{
let html = React.createElement('div',{dangerouslySetInnerHTML: {__html:text}});
})
您正在为 Dropbox /oauth2/authorize, but https://www.dropbox.com/oauth2/authorize 下载数据实际上是一个网页,而不是 API 调用,因此您不应该像这样使用 HTTPS 客户端来下载 HTML 数据.
您应该将用户引导至 https://www.dropbox.com/oauth2/authorize... page in their browser. For example, you can construct the https://www.dropbox.com/oauth2/authorize...URL,然后将其放入 <a>
HTML link用户点击或通过 JavaScript 将他们重定向到那里,具体取决于您的用例。
我一直在将 Dropbox API 和 Dropbox Chooser 实现到 React 应用程序中。当我为登录页面调用 'oauth2/authorize' 时,我收到正确的 HTML,但是当我加载它时,我收到所有有助于设置样式的图像文件的 404 错误。我附上了一张截图来显示错误的样子。知道为什么会发生这种情况或如何解决它吗?
来电:
公理({
方法:'get',
url: 'https://www.dropbox.com/oauth2/authorize?client_id=' + APP_KEY + '&response_type=code',
headers:{
'Content-Type' : 'application/json' ,
'Authorization':授权
}
}).then(函数 (res) {
让 pretty = stringifyObject(res.data, {
单引号:假
});
response.send(pretty);
})
.catch(function (error) {
response.send(error.response.data);
});
抓取:
fetch(URL + '/api/login', {method: "GET"})
.then((res)=>{ return res.text() })
.then((text)=>{
let html = React.createElement('div',{dangerouslySetInnerHTML: {__html:text}});
})
您正在为 Dropbox /oauth2/authorize, but https://www.dropbox.com/oauth2/authorize 下载数据实际上是一个网页,而不是 API 调用,因此您不应该像这样使用 HTTPS 客户端来下载 HTML 数据.
您应该将用户引导至 https://www.dropbox.com/oauth2/authorize... page in their browser. For example, you can construct the https://www.dropbox.com/oauth2/authorize...URL,然后将其放入 <a>
HTML link用户点击或通过 JavaScript 将他们重定向到那里,具体取决于您的用例。