|
@@ -28,8 +28,8 @@ const install = (Vue, vm) => {
|
|
|
// config.header.token = getApp().globalData.username;
|
|
|
|
|
|
// 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的,所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
|
|
|
- let lifeData = uni.getStorageSync('lifeData');
|
|
|
- let token = lifeData.vuex_user?.token;
|
|
|
+ // let lifeData = uni.getStorageSync('lifeData');
|
|
|
+ let token = vm.vuex_user?.token;
|
|
|
if(token){config.header.Authorization = `Bearer ${token}`;}
|
|
|
// console.log('getStorageSync token',token);
|
|
|
// const token = uni.getStorageSync('token');
|