多环境配置

This commit is contained in:
2025-12-02 09:25:35 +08:00
parent 173cbc7f87
commit ba65ab303b
11 changed files with 141 additions and 10 deletions

View File

@@ -12,7 +12,8 @@ let downloadLoadingInstance;
export let isRelogin = { show: false };
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
axios.defaults.headers['X-Tenant-ID'] = '1'
// 从环境变量读取租户ID如果没有则使用默认值'1'
axios.defaults.headers['X-Tenant-ID'] = import.meta.env.VITE_APP_TENANT_ID || '1'
axios.defaults.headers['Request-Method-Name'] = 'login'
// 创建axios实例
const service = axios.create({