From 1d2fa9783d47a19650450b81fc4f2e6c97b1d4ac Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期二, 09 四月 2024 15:38:13 +0800
Subject: [PATCH] 提交一把

---
 server/service/src/main/java/com/doumee/config/shiro/ShiroSessionManager.java               |    2 
 company/.env.developmentCom                                                                 |    7 ++-
 server/service/src/main/java/com/doumee/core/annotation/pr/PreventRepeatDefaultHandler.java |    6 ++
 company/.env                                                                                |    2 +
 company/.env.productionShop                                                                 |    3 +
 company/.env.developmentShop                                                                |    8 ++--
 company/.env.production                                                                     |    2 +
 server/service/src/main/java/com/doumee/biz/system/SystemDictBiz.java                       |    2 
 server/company/src/main/resources/application.yml                                           |    2 +
 server/shop/src/main/resources/application.yml                                              |    2 +
 company/.env.productionCom                                                                  |    3 +
 company/src/components/common/CommonHeader.vue                                              |    6 ++
 company/src/utils/request.js                                                                |    5 +-
 server/platform/src/main/resources/application.yml                                          |    2 +
 server/service/src/main/java/com/doumee/biz/system/impl/SystemDictBizImpl.java              |   12 +++++
 company/src/views/login.vue                                                                 |    4 +
 company/.env.development                                                                    |    6 ++-
 17 files changed, 56 insertions(+), 18 deletions(-)

diff --git a/company/.env b/company/.env
index ddf662e..053cb07 100644
--- a/company/.env
+++ b/company/.env
@@ -8,6 +8,8 @@
 
 # 鎺ュ彛鍓嶇紑
 VUE_APP_API_PREFIX = '/api'
+VUE_APP_SYSTEM_TITLE = '浜戞槗淇濆鎴锋湇鍔$郴缁�'
+VUE_APP_COOKIE_NAME='eva-auth-token'
 
 # 宸ョ瀵煎叆妯℃澘
 VUE_APP_TYPEWORK_URL = 'https://doumeetest.oss-cn-beijing.aliyuncs.com/yunyibao_file/typeWork.xlsx'
diff --git a/company/.env.development b/company/.env.development
index b922744..ee0e9a4 100644
--- a/company/.env.development
+++ b/company/.env.development
@@ -3,10 +3,12 @@
 
 # 鎺ュ彛鍓嶇紑
 # VUE_APP_API_PREFIX = '/yyb_admin_api'
+VUE_APP_SYSTEM_TITLE = '浜戞槗淇濆鎴锋湇鍔$郴缁�-骞冲彴绔�'
 
+VUE_APP_COOKIE_NAME='dmplat-auth-token'
 
 # VUE_APP_API = 'https://dmtest.ahapp.net/yyb_admin_api/'
 
-# VUE_APP_API = 'http://192.168.0.190:10030/'
+VUE_APP_API = 'http://192.168.0.190:10030/'
 
-VUE_APP_API = 'http://localhost:10030/'
+# VUE_APP_API = 'http://localhost:10030/'
diff --git a/company/.env.developmentCom b/company/.env.developmentCom
index 80addd9..cbe5818 100644
--- a/company/.env.developmentCom
+++ b/company/.env.developmentCom
@@ -3,10 +3,11 @@
 
 # 鎺ュ彛鍓嶇紑
 # VUE_APP_API_PREFIX = '/yyb_admin_api'
+VUE_APP_SYSTEM_TITLE = '浜戞槗淇濆鎴锋湇鍔$郴缁�-浼佷笟绔�'
 
-
+VUE_APP_COOKIE_NAME='doumee-auth-token'
 # VUE_APP_API = 'https://dmtest.ahapp.net/yyb_admin_api/'
 
-#VUE_APP_API = 'http://192.168.0.190:10031/'
+VUE_APP_API = 'http://192.168.0.190:10031/'
 
-VUE_APP_API = 'http://localhost:10031/'
+#VUE_APP_API = 'http://localhost:10031/'
diff --git a/company/.env.developmentShop b/company/.env.developmentShop
index 8bbdc82..962e3ac 100644
--- a/company/.env.developmentShop
+++ b/company/.env.developmentShop
@@ -3,10 +3,10 @@
 
 # 鎺ュ彛鍓嶇紑
 # VUE_APP_API_PREFIX = '/yyb_admin_api'
-
-
+VUE_APP_COOKIE_NAME='dmshop-auth-token'
+VUE_APP_SYSTEM_TITLE = '浜戞槗淇濆鎴锋湇鍔$郴缁�-鍟嗘埛绔�'
 # VUE_APP_API = 'https://dmtest.ahapp.net/yyb_admin_api/'
 
-#VUE_APP_API = 'http://192.168.0.190:10032/'
+VUE_APP_API = 'http://192.168.0.190:10032/'
 
-VUE_APP_API = 'http://localhost:10032/'
+#VUE_APP_API = 'http://localhost:10032/'
diff --git a/company/.env.production b/company/.env.production
index 9cf23b3..e4f6857 100644
--- a/company/.env.production
+++ b/company/.env.production
@@ -2,6 +2,8 @@
 NODE_ENV = 'production'
 
 VUE_APP_API_PREFIX = '/yyb_admin_api'
+VUE_APP_COOKIE_NAME='dmplat-auth-token'
+VUE_APP_SYSTEM_TITLE = '浜戞槗淇濆鎴锋湇鍔$郴缁�-骞冲彴绔�'
 
 # 骞冲彴绔�
 VUE_APP_API = 'https://dmtest.ahapp.net/yyb_admin_api/'
diff --git a/company/.env.productionCom b/company/.env.productionCom
index 904fb6a..3e7586a 100644
--- a/company/.env.productionCom
+++ b/company/.env.productionCom
@@ -3,6 +3,9 @@
 
 VUE_APP_API_PREFIX = '/yyb_web_api'
 
+VUE_APP_COOKIE_NAME='doumee-auth-token'
+
+VUE_APP_SYSTEM_TITLE = '浜戞槗淇濆鎴锋湇鍔$郴缁�-浼佷笟绔�'
 # 骞冲彴绔�
 VUE_APP_API = 'https://dmtest.ahapp.net/yyb_web_api/'
 
diff --git a/company/.env.productionShop b/company/.env.productionShop
index d53a8c9..ff33495 100644
--- a/company/.env.productionShop
+++ b/company/.env.productionShop
@@ -2,9 +2,10 @@
 NODE_ENV = 'production'
 
 VUE_APP_API_PREFIX = '/yyb_shop_api'
-
+VUE_APP_COOKIE_NAME='dmshop-auth-token'
 # 骞冲彴绔�
 VUE_APP_API = 'https://dmtest.ahapp.net/yyb_shop_api/'
 
+VUE_APP_SYSTEM_TITLE = '浜戞槗淇濆鎴锋湇鍔$郴缁�-鍟嗘埛绔�'
 # 浼佷笟绔�
 # VUE_APP_API = 'https://dmtest.ahapp.net/yyb_web_api/'
diff --git a/company/src/components/common/CommonHeader.vue b/company/src/components/common/CommonHeader.vue
index 2e9798a..3ad2f60 100644
--- a/company/src/components/common/CommonHeader.vue
+++ b/company/src/components/common/CommonHeader.vue
@@ -2,7 +2,7 @@
   <div class="common-header">
     <div class="header">
       <div class="logo">
-        <div>浜戞槗淇濆鎴锋湇鍔$郴缁�</div>
+        <div>{{systemTitle}}</div>
         <!-- <div class="title-en">Diagnosis of Intelligent Manufacturing Integrated Service Platfrom</div> -->
       </div>
       <div class="user">
@@ -55,6 +55,7 @@
   },
   data () {
     return {
+      systemTitle: process.env.VUE_APP_SYSTEM_TITLE,
       visible: {
         // 淇敼瀵嗙爜
         changePwd: false
@@ -85,6 +86,9 @@
       }
     }
   },
+  created () {
+    document.title=this.systemTitle
+  },
   computed: {
     ...mapState(['menuData', 'userInfo']),
     title () {
diff --git a/company/src/utils/request.js b/company/src/utils/request.js
index 2673a72..39e92c7 100644
--- a/company/src/utils/request.js
+++ b/company/src/utils/request.js
@@ -30,9 +30,10 @@
   // 璁剧疆鎿嶄綔骞冲彴
   config.headers['eva-platform'] = `pc-${pkg.version}`
   // 璁剧疆璁よ瘉澶�
-  const authToken = Cookies.get('eva-auth-token')
+  const cookieName = process.env.VUE_APP_COOKIE_NAME || 'eva-auth-token'
+  const authToken = Cookies.get(cookieName)
   if (authToken != null) {
-    config.headers['eva-auth-token'] = authToken
+    config.headers[cookieName] = authToken
   }
   return config
 }, function (error) {
diff --git a/company/src/views/login.vue b/company/src/views/login.vue
index 1ea5e75..e5b79f1 100644
--- a/company/src/views/login.vue
+++ b/company/src/views/login.vue
@@ -1,7 +1,7 @@
 <template>
     <div class="wrap">
         <div class="introduce">
-            <h2>浜戞槗淇濆鎴锋湇鍔$郴缁�</h2>
+            <h2>{{systemTitle}}</h2>
         </div>
         <div class="login">
             <h1>绯荤粺鐧诲綍&nbsp;/&nbsp;LOGIN IN</h1>
@@ -42,6 +42,7 @@
         name: 'Login',
         data () {
             return {
+                systemTitle: process.env.VUE_APP_SYSTEM_TITLE,
                 loading: false,
                 username: '',
                 password: '',
@@ -183,6 +184,7 @@
         },
         created () {
             this.refreshCaptcha()
+            document.title=this.systemTitle
         }
     }
 </script>
diff --git a/server/company/src/main/resources/application.yml b/server/company/src/main/resources/application.yml
index 83ded24..dba634a 100644
--- a/server/company/src/main/resources/application.yml
+++ b/server/company/src/main/resources/application.yml
@@ -25,6 +25,8 @@
       max-file-size: 200MB
       max-request-size: 200MB
       enabled: true
+
+cookiename: doumee-auth-token
 # MyBatis閰嶇疆
 mybatis-plus:
   mapper-locations: classpath*:/mappers/**/*.xml
diff --git a/server/platform/src/main/resources/application.yml b/server/platform/src/main/resources/application.yml
index 2d0245f..368c575 100644
--- a/server/platform/src/main/resources/application.yml
+++ b/server/platform/src/main/resources/application.yml
@@ -25,6 +25,8 @@
       max-request-size: 200MB
       enabled: true
 
+cookiename: dmplat-auth-token
+
 # MyBatis閰嶇疆
 mybatis-plus:
   mapper-locations: classpath*:/mappers/**/*.xml
diff --git a/server/service/src/main/java/com/doumee/biz/system/SystemDictBiz.java b/server/service/src/main/java/com/doumee/biz/system/SystemDictBiz.java
index 6255d57..f9160f4 100644
--- a/server/service/src/main/java/com/doumee/biz/system/SystemDictBiz.java
+++ b/server/service/src/main/java/com/doumee/biz/system/SystemDictBiz.java
@@ -8,7 +8,7 @@
  * @date 2023/02/14 11:14
  */
 public interface SystemDictBiz {
-
+    void initAuthToken( );
     /**
      * 鍒涘缓
      * @author Eva.Caesar Liu
diff --git a/server/service/src/main/java/com/doumee/biz/system/impl/SystemDictBizImpl.java b/server/service/src/main/java/com/doumee/biz/system/impl/SystemDictBizImpl.java
index 6f33422..13f1d37 100644
--- a/server/service/src/main/java/com/doumee/biz/system/impl/SystemDictBizImpl.java
+++ b/server/service/src/main/java/com/doumee/biz/system/impl/SystemDictBizImpl.java
@@ -1,20 +1,30 @@
 package com.doumee.biz.system.impl;
 
 import com.doumee.biz.system.SystemDictBiz;
+import com.doumee.config.shiro.ShiroSessionManager;
 import com.doumee.core.constants.ResponseStatus;
 import com.doumee.core.exception.BusinessException;
 import com.doumee.dao.system.model.SystemDict;
 import com.doumee.service.system.SystemDictService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
 
 @Service
 public class SystemDictBizImpl implements SystemDictBiz {
-
+    @Value("${cookiename}")
+    private String authToken;
     @Autowired
     private SystemDictService systemDictService;
 
     @Override
+    @PostConstruct
+    public void initAuthToken( ) {
+        ShiroSessionManager.AUTH_TOKEN = authToken;
+    }
+    @Override
     public Integer create(SystemDict systemDict) {
         SystemDict queryDto = new SystemDict();
         queryDto.setCode(systemDict.getCode());
diff --git a/server/service/src/main/java/com/doumee/config/shiro/ShiroSessionManager.java b/server/service/src/main/java/com/doumee/config/shiro/ShiroSessionManager.java
index a279ee8..758cb4f 100644
--- a/server/service/src/main/java/com/doumee/config/shiro/ShiroSessionManager.java
+++ b/server/service/src/main/java/com/doumee/config/shiro/ShiroSessionManager.java
@@ -24,7 +24,7 @@
 @Slf4j
 public class ShiroSessionManager extends DefaultSessionManager implements WebSessionManager {
 
-    private static final String AUTH_TOKEN = "doumee-auth-token";
+    public static   String AUTH_TOKEN = "";
 
     @Override
     protected void onStart(Session session, SessionContext context) {
diff --git a/server/service/src/main/java/com/doumee/core/annotation/pr/PreventRepeatDefaultHandler.java b/server/service/src/main/java/com/doumee/core/annotation/pr/PreventRepeatDefaultHandler.java
index ed7b245..1ea8aab 100644
--- a/server/service/src/main/java/com/doumee/core/annotation/pr/PreventRepeatDefaultHandler.java
+++ b/server/service/src/main/java/com/doumee/core/annotation/pr/PreventRepeatDefaultHandler.java
@@ -1,5 +1,6 @@
 package com.doumee.core.annotation.pr;
 
+import com.doumee.config.shiro.ShiroSessionManager;
 import com.doumee.core.servlet.ServletDuplicateInputStream;
 import com.doumee.core.utils.Utils;
 import lombok.extern.slf4j.Slf4j;
@@ -20,6 +21,9 @@
 @Slf4j
 @Component
 public class PreventRepeatDefaultHandler extends PreventRepeatAdapter {
+
+
+//    private static  String USER_TOKEN_NAME = "eva-auth-token";
 
     @Override
     public String sign(HttpServletRequest request) {
@@ -42,7 +46,7 @@
     private Map<String, Object> getParameters(HttpServletRequest request) {
         HashMap<String, Object> paramMap = new HashMap<>();
         paramMap.put("REQUEST_URI", request.getRequestURI());
-        paramMap.put("USER_TOKEN", String.valueOf(request.getHeader("eva-auth-token")));
+        paramMap.put("USER_TOKEN", String.valueOf(request.getHeader(ShiroSessionManager.AUTH_TOKEN)));
         paramMap.put("IP", Utils.User_Client.getIP(request));
         return paramMap;
     }
diff --git a/server/shop/src/main/resources/application.yml b/server/shop/src/main/resources/application.yml
index 68dd011..0252e02 100644
--- a/server/shop/src/main/resources/application.yml
+++ b/server/shop/src/main/resources/application.yml
@@ -25,6 +25,8 @@
       max-file-size: 200MB
       max-request-size: 200MB
       enabled: true
+
+cookiename: dmshop-auth-token
 # MyBatis閰嶇疆
 mybatis-plus:
   mapper-locations: classpath*:/mappers/**/*.xml

--
Gitblit v1.9.3