使用动态 token,去除全局写死

pull/5/head
YunaiV 2023-10-06 02:10:56 +08:00
parent c36415fcda
commit 7e55249b79
1 changed files with 4 additions and 2 deletions

View File

@ -52,10 +52,12 @@ function baseRequest(url, method, data, {
...header
}
header['tenant-id'] = 1
header['Authorization'] = 'Bearer test247'
}
if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
if (store.state.app.token) {
// header[TOKENNAME] = store.state.app.token;
header['Authorization'] = 'Bearer ' + store.state.app.token;
}
return new Promise((reslove, reject) => {
uni.request({
// url: url.indexOf('app-api') < 0 ? Url + '/api/front/' + url