mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-18 08:33:49 +08:00
Pre-combine with JiaMin
This commit is contained in:
@@ -20,14 +20,20 @@ export default async(url = '', data = {}, type = 'GET', method = 'fetch') => {
|
||||
}
|
||||
|
||||
if (window.fetch && method === 'fetch') {
|
||||
let token='';
|
||||
let tokenStr = localStorage.getItem("userInfo");
|
||||
if(tokenStr){
|
||||
tokenStr = JSON.parse(tokenStr);
|
||||
if(tokenStr && tokenStr.xaccessToken)
|
||||
token=tokenStr.xaccessToken;
|
||||
}
|
||||
let requestConfig = {
|
||||
|
||||
method: type,
|
||||
headers: {
|
||||
// 'Accept': 'text/plain',
|
||||
'Content-Type': 'application/json'
|
||||
'Content-Type': 'application/json',
|
||||
'x-access-token': token
|
||||
},
|
||||
|
||||
mode: 'cors',
|
||||
// channelId:'H5@2021',
|
||||
cache: 'force-cache'
|
||||
|
||||
Reference in New Issue
Block a user