修改cas配置为全局配置,修复前端路由报错,修改校验跳转方式
This commit is contained in:
@@ -28,12 +28,11 @@ mybatis:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
hcframe:
|
||||
cas:
|
||||
enabled: true
|
||||
casServiceUrl: http://192.168.1.131:8080
|
||||
clientContextPath: /
|
||||
white-url: ^(.*(/logout?))|(/user/cas/url)$
|
||||
cas-context-path: /cas
|
||||
service-url: http://192.168.1.130:9527
|
||||
cookie-holder-pattern: com.hcframe.gateway.config.MyDataStorage
|
||||
login-url: /login
|
||||
logout-url: /logout
|
||||
white-url: @cas.white-url@
|
||||
cas-context-path: @cas.cas-context-path@
|
||||
service-url: @cas.service-url@
|
||||
cookie-holder-pattern: @cas.cookie-holder-pattern@
|
||||
login-url: @cas.login-url@
|
||||
logout-url: @cas.logout-url@
|
||||
cas-service-url: @cas.cas-service-url@
|
||||
client-context-path: @cas.client-context-path@
|
||||
|
||||
@@ -26,12 +26,6 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.reflections/reflections -->
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -23,7 +23,7 @@ public class GatewayController {
|
||||
try {
|
||||
Map<String,String> map=new HashMap<>(2);
|
||||
map.put("cas", casGatewayClientConfig.casServiceUrl + casGatewayClientConfig.casContextPath + casGatewayClientConfig.getLoginUrl());
|
||||
map.put("config", casGatewayClientConfig.casServiceUrl);
|
||||
map.put("config", casGatewayClientConfig.serviceUrl+casGatewayClientConfig.getClientContextPath());
|
||||
resultMap.put("code", 0);
|
||||
resultMap.put("msg", "");
|
||||
resultMap.put("data", map);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class CasController {
|
||||
}
|
||||
}
|
||||
webUrl = URLDecoder.decode(webUrl, "utf-8");
|
||||
response.sendRedirect("http://"+webUrl+"/#/login?token=" + token + "&redirect=%2Fdashboard");
|
||||
response.sendRedirect("http://"+webUrl+"/#/?token=" + token );
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ server:
|
||||
pagehelper:
|
||||
auto-runtime-dialect: true
|
||||
cas:
|
||||
server-url-prefix: http://192.168.1.131:8080/cas
|
||||
client-host-url: http://192.168.1.130:8080
|
||||
server-url-prefix: @cas.cas-service-url@
|
||||
client-host-url: @cas.service-url@
|
||||
validation-type: cas3
|
||||
server-login-url: http://192.168.1.131:8080/cas/login
|
||||
server-login-url: @cas.logout-url@
|
||||
spring:
|
||||
application:
|
||||
name: cloud-user
|
||||
|
||||
@@ -140,11 +140,11 @@
|
||||
<redis.port>6379</redis.port>
|
||||
<redis.password/>
|
||||
<!-- cas配置 -->
|
||||
<cas.enabled>true</cas.enabled>
|
||||
<cas.client-context-path>/user/cas/valid</cas.client-context-path>
|
||||
<cas.cas-service-url>http://192.168.1.131:8080</cas.cas-service-url>
|
||||
<cas.cas-context-path>/cas</cas.cas-context-path>
|
||||
<cas.white-url>^(.*(/logout?))|(/user/cas/url)$</cas.white-url>
|
||||
<cas.service-url>http://192.168.1.130:9527</cas.service-url>
|
||||
<cas.white-url>^.*(/logout?)$</cas.white-url>
|
||||
<cas.service-url>http://192.168.1.130:8084</cas.service-url>
|
||||
<cas.cookie-holder-pattern>com.hcframe.gateway.config.MyDataStorage</cas.cookie-holder-pattern>
|
||||
<cas.login-url>/login</cas.login-url>
|
||||
<cas.logout-url>/logout</cas.logout-url>
|
||||
|
||||
Reference in New Issue
Block a user