提交 206f8554 authored 作者: 钟是志's avatar 钟是志

鉴权修改

上级 c1e7803d
...@@ -268,20 +268,20 @@ export async function requestOrigin(url, data, options = {}){ ...@@ -268,20 +268,20 @@ export async function requestOrigin(url, data, options = {}){
options.headers = getHeaders(url).headers; options.headers = getHeaders(url).headers;
} }
let trueUrl = (options.prefix || '') + url; let trueUrl = (options.prefix || '') + url;
trueUrl = await getTransformApi(trueUrl); const { transformApi, headersApi } = await getTransformApi(trueUrl);
if(options.headers){ if(options.headers){
options.headers = { options.headers = {
...options.headers, ...options.headers,
apis: trueUrl && trueUrl.indexOf('/safe/pub/getApis') > -1 ? window.onestopTransformApis : undefined, apis: headersApi,
} };
}else{ }else{
options.headers = { options.headers = {
apis: trueUrl && trueUrl.indexOf('/safe/pub/getApis') > -1 ? window.onestopTransformApis : undefined, apis: headersApi,
} };
} }
delete options.prefix; delete options.prefix;
// POST请求 // POST请求
return fetchRequest(trueUrl, { return fetchRequest(transformApi, {
data: pp, data: pp,
// method: "POST", // method: "POST",
requestType: 'form', requestType: 'form',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论