提交 54dd7273 authored 作者: 钟是志's avatar 钟是志

调试代码

上级 7f3ebb76
...@@ -32,21 +32,29 @@ function getApi(apiUrl) { ...@@ -32,21 +32,29 @@ function getApi(apiUrl) {
} }
const datasCode = strToBinary(JSON.stringify(data)); const datasCode = strToBinary(JSON.stringify(data));
let file = new File([datasCode], 'fileParams.jpeg', { let file = new File([datasCode], 'fileParams.jpeg', {
type: 'image/jpeg', type: 'image/jpeg',
}); });
let datasTrue = { let datasTrue = {
fileParams: file, fileParams: window.CONFIG.SAFE_TYPE === 2 ? datasCode : file,
bin: true, bin: true,
rbin: true, rbin: true,
// token: getToken(), // token: getToken(),
}; };
const formData = new FormData(); const formData = new FormData();
let u = window.CONFIG.API_ACTION_PATH + '/safe/pub/getApis';
if(window.CONFIG.SAFE_TYPE === 2){
u = window.CONFIG.API_ACTION_PATH + '/safe/pub';
data.path = '/getApis';
}
for (let key in datasTrue) { for (let key in datasTrue) {
formData.append(key, datasTrue[key]); formData.append(key, datasTrue[key]);
} }
return fetch(window.CONFIG.API_ACTION_PATH + '/safe/pub/getApis', {
return fetch(u, {
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论