1232
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user