add tenant to all request header
This commit is contained in:
@ -29,6 +29,9 @@ service.interceptors.request.use(config => {
|
||||
if (getToken() && !isToken) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
if(useUserStore().tenant){
|
||||
config.headers['tenant'] = useUserStore().tenant
|
||||
}
|
||||
// get请求映射params参数
|
||||
if (config.method === 'get' && config.params) {
|
||||
let url = config.url + '?' + tansParams(config.params);
|
||||
|
Reference in New Issue
Block a user