Quellcode durchsuchen

生产打包配置值

csg6 vor 1 Tag
Ursprung
Commit
b0a1187328

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java

@@ -43,7 +43,7 @@ public class SysLoginController {
43 43
      * @return 结果
44 44
      */
45 45
     //TODO 打包屏蔽-甲方部署时注释:甲方不需要本地登录功能采用单点登录
46
-    @PostMapping("/login")
46
+    /*@PostMapping("/login")
47 47
     public AjaxResult login(@RequestBody LoginBody loginBody) {
48 48
         AjaxResult ajax = AjaxResult.success();
49 49
 
@@ -51,7 +51,7 @@ public class SysLoginController {
51 51
         String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), loginBody.getUuid(), true);
52 52
         ajax.put(Constants.TOKEN, token);
53 53
         return ajax;
54
-    }
54
+    }*/
55 55
 
56 56
     /**
57 57
      * 获取用户信息

+ 11 - 11
ruoyi-common/src/main/java/com/ruoyi/common/filter/RestCorsFilter.java

@@ -22,8 +22,8 @@ import java.util.Set;
22 22
 public class RestCorsFilter implements Filter {
23 23
 
24 24
     //配置文件:application-cas-test.yml -> caseitc:
25
-//    @Autowired
26
-//    private CasConfig casConfig;
25
+    @Autowired
26
+    private CasConfig casConfig;
27 27
 
28 28
 
29 29
     public RestCorsFilter() {
@@ -42,10 +42,10 @@ public class RestCorsFilter implements Filter {
42 42
         log.info("【跨域过滤器】request.getRequestURL() = " + request.getRequestURL());//http://192.168.3.200:8180/system/role/41749924753409
43 43
 //        log.info("【跨域过滤器】request.getServletContext().getRealPath(\"/\") = " + request.getServletContext().getRealPath("/"));//获取“/”在机器中的实际地址 C:\Users\15753\AppData\Local\Temp\tomcat-docbase.8180.7251487789088039644\
44 44
 
45
-//        String serverLoginUrl = casConfig.getServerLoginUrl();
46
-//        String webStartPage = casConfig.getWebStartPage();
47
-//        log.info("【跨域过滤器】serverLoginUrl = " + serverLoginUrl);
48
-//        log.info("【跨域过滤器】webStartPage = " + webStartPage);
45
+        String serverLoginUrl = casConfig.getServerLoginUrl();//单点地址:http://10.152.70.21:8080/cas/login
46
+        String webStartPage = casConfig.getWebStartPage();//前端Ngxin地址:http://10.152.72.7:8181/postcheck
47
+        log.info("【跨域过滤器】设置动态从配置文件中取值-单点地址(注意:应该需要切割“/cas/login”,如果前端提示跨域需要处理一下端口的地址) = " + serverLoginUrl);
48
+        log.info("【跨域过滤器】设置动态从配置文件中取值-前端Ngxin地址(注意:应该需要切割“/postcheck”,如果前端提示跨域需要处理一下端口的地址) = " + webStartPage);
49 49
 
50 50
         // 允许的来源
51 51
         String[] allowDomain = {
@@ -54,9 +54,9 @@ public class RestCorsFilter implements Filter {
54 54
                 "http://10.152.72.7:8180" // 岗检JAVA接口
55 55
                 // "*.cnooc.*"
56 56
                 // TODO 打包屏蔽-甲方部署时注释:甲方不需要本地登录功能采用单点登录
57
-                , "http://192.168.3.187:8181"  // 前端开发-王宇
58
-                , "http://192.168.3.32:81"  // 前端开发-李帅
59
-                , "http://192.168.3.200:8181"  // 前端开发
57
+//                , "http://192.168.3.187:8181"  // 前端开发-王宇
58
+//                , "http://192.168.3.32:81"  // 前端开发-李帅
59
+//                , "http://192.168.3.200:8181"  // 前端开发
60 60
         };
61 61
         Set<String> allowedOrigins = new HashSet<>(Arrays.asList(allowDomain));
62 62
         String originHeader = request.getHeader("Origin");
@@ -65,9 +65,9 @@ public class RestCorsFilter implements Filter {
65 65
         //前端的头Origin为空时设置为前端Nginx的地址
66 66
         //前端跳转方式:src/views/postcheck.vue -> window.location.href = `${this.getBaseUrl()}/redirectpostcheck`;
67 67
         if (StringUtils.isBlank(originHeader)) {
68
-//            originHeader = "http://10.152.72.7:8181";//岗检前端Nginx
68
+            originHeader = "http://10.152.72.7:8181";//岗检前端Nginx
69 69
 //            originHeader = "http://10.152.72.7:8180";//岗检JAVA接口
70
-            originHeader = "http://192.168.3.32:81";//李帅
70
+//            originHeader = "http://192.168.3.32:81";//李帅
71 71
 //            originHeader = "http://192.168.3.187:8181";//王宇
72 72
             log.info("【跨域过滤器】拿到请求中的request.getHeader(\"Origin\") 等于空,服务器设置默认值后 = {}", originHeader);
73 73
         }

+ 2 - 2
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/cas/CasConfigure.java

@@ -9,8 +9,8 @@ import net.unicon.cas.client.configuration.EnableCasClient;
9 9
 /**
10 10
  * TODO 甲方部署时打开:CAS统一认证拦截器
11 11
  */
12
-//@EnableCasClient
13
-//@Configuration
12
+@EnableCasClient
13
+@Configuration
14 14
 public class CasConfigure extends CasClientConfigurerAdapter {
15 15
     @Override
16 16
     public void configureAuthenticationFilter(FilterRegistrationBean authenticationFilter) {