This commit is contained in:
lcj
2026-09-11 17:31:59 +08:00
parent dac4260d73
commit b4360ada34
5 changed files with 77 additions and 43 deletions
+2 -6
View File
@@ -27,8 +27,8 @@ const install = (Vue, vm) => {
// config.header.token = getApp().globalData.username;
// 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的,所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
const token = uni.getStorageSync('tokenGift');
config.header.Authorization = 'Bearer '+token;
const auth = uni.getStorageSync('authorizationGift');
if (auth) config.header.Authorization = auth;
return config;
}
@@ -41,10 +41,6 @@ const install = (Vue, vm) => {
// 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么
return res;
}else if(res.errcode==-99){
uni.navigateTo({
url:'/pages/index/login'
})
}else {
// uni.showToast({