提交 2eb37c9e authored 作者: 钟是志's avatar 钟是志

优化代码

上级 2a143da5
......@@ -63,7 +63,7 @@ export const qqCw = ({
return undefined;
};
const objectToQuery = function (param, key, encode) {
const objectToQuery = function(param, key, encode) {
if (param == null) return '';
var paramStr = '';
var t = typeof param;
......@@ -134,8 +134,12 @@ export const request = (url, data, options = {}) => {
if (url && test === 'true') {
console.log(url, data);
}
if(url.indexOf('queryInfo') > -1){
debugger;
}
return giveBase16EnCode(data, url)
.then((newData) => {
if (typeof newData === 'object' && newData.url && newData.datas) {
return requestFileInfo(newData.url, newData.datas);
}
......@@ -150,6 +154,7 @@ export const requestOrigin = (url, data, options = {}) => {
? JSON.parse(localStorage.getItem('version'))
: null;
if (options.method === 'GET') {
const pp = {
...data,
......@@ -258,10 +263,15 @@ export const requestOrigin = (url, data, options = {}) => {
url = '/UserApi/login'; // 通过 proxy代理 解决登录接口本地跨域问题
options.prefix = '';
}
if (getToken()) {
options.headers = {
Authorization: `bearer ${getToken()}`,
};
}
return fetchRequest(url, {
data: pp,
// method: "POST",
requestType: 'form',
...options,
})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论