feat(dev): 增加独立分销前台端口5191、标签页会话隔离与免hosts二级域名支持
This commit is contained in:
@@ -3,6 +3,7 @@ import { ElMessage } from 'element-plus'
|
||||
import { showToast } from 'vant'
|
||||
import { apiMonitor } from './monitor'
|
||||
import { debugError, debugLog } from '@/shared/utils/debug'
|
||||
import { getEffectiveSiteCode } from '@/stores/distributionSite'
|
||||
|
||||
function showError(message: string) {
|
||||
const isMobile = window.location.pathname.startsWith('/m')
|
||||
@@ -201,11 +202,9 @@ apiClient.interceptors.request.use(
|
||||
config.headers.Authorization = `Bearer ${token}`
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
const siteCode = localStorage.getItem('hfb_site_code')
|
||||
if (siteCode && !config.headers['X-Distribution-Site-Code']) {
|
||||
config.headers['X-Distribution-Site-Code'] = siteCode
|
||||
}
|
||||
const siteCode = getEffectiveSiteCode()
|
||||
if (siteCode && !config.headers['X-Distribution-Site-Code']) {
|
||||
config.headers['X-Distribution-Site-Code'] = siteCode
|
||||
}
|
||||
|
||||
// 记录请求日志
|
||||
|
||||
Reference in New Issue
Block a user