mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-13 02:57:11 +08:00
refactor(tenant): 优化租户相关代码
This commit is contained in:
@@ -52,17 +52,14 @@ const handleError = (msg: string) => {
|
||||
http.interceptors.request.use(
|
||||
(config: AxiosRequestConfig) => {
|
||||
const token = getToken()
|
||||
if (!config.headers) {
|
||||
config.headers = {}
|
||||
}
|
||||
if (token) {
|
||||
if (!config.headers) {
|
||||
config.headers = {}
|
||||
}
|
||||
config.headers.Authorization = `Bearer ${token}`
|
||||
}
|
||||
const tenantId = getTenantId()
|
||||
if (tenantId) {
|
||||
if (!config.headers) {
|
||||
config.headers = {}
|
||||
}
|
||||
config.headers['X-Tenant-Id'] = tenantId
|
||||
}
|
||||
return config
|
||||
|
Reference in New Issue
Block a user