Forráskód Böngészése

fix(api): 修复请求头中租户编码默认值及环境配置

- 修正请求实例中 'X-Tenant-code' 头为系统租户编码或默认值 'zswl'
- 注释生产环境API地址,改为新的IP地址以匹配当前环境
- 移除manifest.json尾部多余空白行
- 添加调试日志输出当前运行模式
zhangtao 4 napja
szülő
commit
24d41e4df2
2 módosított fájl, 5 hozzáadás és 4 törlés
  1. 2 3
      src/api/core/instance.ts
  2. 3 1
      src/config/index.ts

+ 2 - 3
src/api/core/instance.ts

@@ -15,9 +15,8 @@ export const alovaInstance = createAlova({
     }
     const { token } = useUserStore()
     method.config.headers.Authorization = token || 'Basic c21xamgtYXBwbGV0OjEyMzQ1Ng=='
-    // #ifdef H5
-    method.config.headers['X-Tenant-code'] = useSysStore().tenantCode
-    // #endif
+
+    method.config.headers['X-Tenant-code'] = useSysStore().tenantCode || 'zswl'
 
     if (method.type === 'GET' && CommonUtil.isObj(method.config.params)) {
       method.config.params._t = Date.now()

+ 3 - 1
src/config/index.ts

@@ -50,8 +50,10 @@ function handleEnvVersion() {
     development: 'http://192.168.0.11:8081',
     // development: 'http://192.168.1.21:8080',
     // development: 'https://smqjh.api.zswlgz.com',
-    production: 'https://smqjh.api.zswlgz.com',
+    // production: 'https://smqjh.api.zswlgz.com',
+    production: 'http://47.109.84.152:8081',
   }
+  console.log(mode, '==================mode===================')
   return h5Server[mode as 'development' | 'production']
   // #endif
   // #ifdef MP-WEIXIN