新增功能:收银台
This commit is contained in:
@@ -10,7 +10,7 @@ import { API_BASE_URL, TOKEN_HEADER_NAME, LAYOUT_PATH } from '@/config/setting';
|
||||
import { getToken, setToken } from './token-util';
|
||||
import { logout } from './page-tab-util';
|
||||
import type { ApiResult } from '@/api';
|
||||
import { getHostname, getTenantId } from "@/utils/domain";
|
||||
import { getHostname, getTenantId } from '@/utils/domain';
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: API_BASE_URL
|
||||
@@ -35,18 +35,17 @@ service.interceptors.request.use(
|
||||
config.headers.common['CompanyId'] = companyId;
|
||||
}
|
||||
// 通过网站域名获取租户ID
|
||||
if (getHostname()){
|
||||
if (getHostname()) {
|
||||
config.headers.common['Domain'] = getHostname();
|
||||
}
|
||||
// 解析二级域名获取租户ID
|
||||
if (getTenantId()) {
|
||||
config.headers.common['TenantId'] = getTenantId();
|
||||
console.log('domain');
|
||||
console.log('domain', getTenantId());
|
||||
return config;
|
||||
}
|
||||
if (TENANT_ID) {
|
||||
config.headers.common['TenantId'] = TENANT_ID;
|
||||
console.log('TENANT_ID');
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user