完善开关
This commit is contained in:
parent
704efa6243
commit
2033c9c985
|
@ -28,7 +28,6 @@ const install = (Vue, vm) => {
|
|||
'content-type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
})
|
||||
|
||||
// 请求拦截部分,如配置,每次请求前都会执行
|
||||
Vue.prototype.$u.http.interceptor.request = (config) => {
|
||||
// 引用token
|
||||
|
@ -44,12 +43,10 @@ const install = (Vue, vm) => {
|
|||
// 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的
|
||||
// 所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
|
||||
const token = uni.getStorageSync('token');
|
||||
|
||||
// const token = " eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImE1ZmE2YzM0LWM0Y2YtNGEwMS05YjY2LTE1M2M4YWY1YzU1YSJ9.Wze_tAjY7cCfw2K6mtDpTSd-QFLRF4A49Fx7bq7g2tVLKL4v5bqqHfpG0VQy7_a_CUQch5RPBTBIKMVCDupIqg"
|
||||
|
||||
// console.log("我是token", token)
|
||||
config.header.Authorization = token;
|
||||
// config.header.Tenant-Id=1
|
||||
// config.header.Tenant-Id=1
|
||||
// #ifdef H5
|
||||
config.header.Authorization = 'Bearer '+token;
|
||||
// #endif
|
||||
|
@ -126,7 +123,6 @@ const install = (Vue, vm) => {
|
|||
}
|
||||
},
|
||||
})
|
||||
|
||||
}
|
||||
return res;
|
||||
// else if(res.code == 201) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user