新增功能:收银台

This commit is contained in:
2024-08-05 01:33:10 +08:00
parent 05f890f343
commit 1d81fa9270
37 changed files with 3655 additions and 74 deletions

View File

@@ -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;
}
}