This commit is contained in:
quantulr
2023-08-31 16:24:37 +08:00
parent 0288146b0d
commit 5bbe958729
32 changed files with 317 additions and 105 deletions

View File

@ -46,9 +46,11 @@ class HttpClient {
url = `${this.baseUrl}${req.url}${paramsString}`;
}
const app = getApp();
const header: any = req.header ?? {};
if (!authWhitelist.includes(req.url)) {
header.Authorization = `Bearer ${app.globalData.authToken}`;
if (!authWhitelist.includes(req.url) && !header.Authorization) {
header.Authorization = `Bearer ${app?.globalData?.authToken}`;
}
return new Promise(function (resolve, reject) {
wx.request({