feat: 完成前端切换功能

This commit is contained in:
橙子
2024-02-09 16:52:17 +08:00
parent 36f72c857d
commit 58fceea247
7 changed files with 38 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
import axios from 'axios'
import { ElNotification, ElMessageBox, ElMessage, ElLoading } from 'element-plus'
import { getToken } from '@/utils/auth'
import { getToken,getTenantId } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
import { tansParams, blobValidate } from '@/utils/ruoyi'
import cache from '@/plugins/cache'
@@ -67,7 +67,12 @@ service.interceptors.request.use(config => {
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
console.log(getTenantId(),"uuu");
if(getTenantId()!==undefined&&getTenantId()!==null&&getTenantId()!=='null')
{
console.log('爆炸');
config.headers['__tenant'] = getTenantId()
}
// get请求映射params参数
if (config.method === 'get' && config.params) {