浏览代码

集团编码用vuex

zhangyu 4 年之前
父节点
当前提交
e797b3af96
共有 3 个文件被更改,包括 11 次插入4 次删除
  1. 1 1
      src/api/httputils.ts
  2. 1 1
      src/store/modules/user.ts
  3. 9 2
      vue.config.js

+ 1 - 1
src/api/httputils.ts

@@ -23,7 +23,7 @@ axiosservice.interceptors.request.use(
         config.withCredentials = true; // 允许携带token ,这个是解决跨域产生的相关问题
         config.headers = {
             projectId: UserModule.projectId, // 'Pj1101050029',//项目id
-            groupCode: 'WD', // 集团编码
+            groupCode: UserModule.group, // 集团编码
             // "X-Access-Token": UserModule.token, // token
         };
         return config;

+ 1 - 1
src/store/modules/user.ts

@@ -28,7 +28,7 @@ class User extends VuexModule implements IUserState {
     public name = "";
     public username = "yanruolan";
     public userId = "06328a53c69a41bb8f5bb1a552c6e8d6";
-    public group = "";// 集团
+    public group = "WD";// 集团
     public projectId = "Pj4403070003";// 深圳龙岗万达广场
     public projects: any[] = [];// 用户项目列表
     public avatar = "";

+ 9 - 2
vue.config.js

@@ -34,11 +34,18 @@ module.exports = {
                 target: "http://192.168.64.17:28890",
                 changeOrigin: true
             },
+            // "/modelapi": {
+            //     target: "http://192.168.64.17:28890",
+            //     changeOrigin: true,
+            //     pathRewrite: {
+            //         "^/modelapi": "/revit-algorithm"
+            //     }
+            // },
             "/modelapi": {
-                target: "http://192.168.64.17:28890",
+                target: "http://192.168.0.55:8080",
                 changeOrigin: true,
                 pathRewrite: {
-                    "^/modelapi": "/revit-algorithm"
+                    "^/modelapi": "/"
                 }
             },
             "/message-center": {