Commit 9cc1a24b4a51e1d6cc7d6d5bce04cf28a988a8b6
1 parent
fc43ea0e
CAS单点登录代码提交
Signed-off-by: TanYibin <5491541@qq.com>
Showing
9 changed files
with
23 additions
and
23 deletions
ant-design-vue-jeecg/.env.development
... | ... | @@ -2,7 +2,7 @@ NODE_ENV=development |
2 | 2 | VUE_APP_ENV=development |
3 | 3 | outputDir=dist |
4 | 4 | VUE_APP_API_BASE_URL=http://localhost:8080/wms |
5 | -VUE_APP_CAS_BASE_URL=http://localhost:8443/cas | |
5 | +VUE_APP_CAS_BASE_URL=http://172.16.29.77:8443/cas | |
6 | 6 | VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview |
7 | 7 | |
8 | 8 | # 微应用列表必须VUE_APP_SUB_开头,jeecg-app-1为子应用的项目名称,也是子应用的路由父路径 |
... | ... |
ant-design-vue-jeecg/src/cas/sso.js
... | ... | @@ -10,7 +10,7 @@ const init = (callback) => { |
10 | 10 | console.log("-------单点登录开始-------"); |
11 | 11 | let token = Vue.ls.get(ACCESS_TOKEN); |
12 | 12 | let st = getUrlParam("ticket"); |
13 | - let sevice = "http://" + window.location.host + "/"; | |
13 | + let sevice = "http://" + window.location.host + "/wms/"; | |
14 | 14 | if (token) { |
15 | 15 | loginSuccess(callback); |
16 | 16 | } else { |
... | ... | @@ -61,7 +61,7 @@ function validateSt(ticket, service, callback) { |
61 | 61 | if (res.success) { |
62 | 62 | loginSuccess(callback); |
63 | 63 | } else { |
64 | - let sevice = "http://" + window.location.host + "/"; | |
64 | + let sevice = "http://" + window.location.host + "/wms/"; | |
65 | 65 | let serviceUrl = encodeURIComponent(sevice); |
66 | 66 | window.location.href = window._CONFIG['casPrefixUrl'] + "/login?service=" + serviceUrl; |
67 | 67 | } |
... | ... |
ant-design-vue-jeecg/src/store/modules/user.js
... | ... | @@ -183,7 +183,7 @@ const user = { |
183 | 183 | //console.log('logoutToken: '+ logoutToken) |
184 | 184 | logout(logoutToken).then(() => { |
185 | 185 | if (process.env.VUE_APP_SSO == 'true') { |
186 | - let sevice = 'http://' + window.location.host + '/' | |
186 | + let sevice = 'http://' + window.location.host + '/wms/' | |
187 | 187 | let serviceUrl = encodeURIComponent(sevice) |
188 | 188 | window.location.href = process.env.VUE_APP_CAS_BASE_URL + '/logout?service=' + serviceUrl |
189 | 189 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/cas/util/CASServiceUtil.java
... | ... | @@ -19,9 +19,9 @@ import org.apache.http.impl.client.HttpClients; |
19 | 19 | public class CASServiceUtil { |
20 | 20 | |
21 | 21 | public static void main(String[] args) { |
22 | - String serviceUrl = "https://cas.8f8.com.cn:8443/cas/p3/serviceValidate"; | |
23 | - String service = "http://localhost:3003/user/login"; | |
24 | - String ticket = "ST-5-1g-9cNES6KXNRwq-GuRET103sm0-DESKTOP-VKLS8B3"; | |
22 | + String serviceUrl = "http://172.16.29.77:8443/cas/"; | |
23 | + String service = "http://localhost:8080/wms/sys/cas/client/validateLogin"; | |
24 | + String ticket = "TGT-4-P-Usqyx62yy2fMVUL7iWlrww-yQ4ClsrhZn5bPgdHqjrOWYeGEs9VrdE-a9dm5FOB44localhost"; | |
25 | 25 | String res = getSTValidate(serviceUrl, ticket, service); |
26 | 26 | |
27 | 27 | System.out.println("---------res-----" + res); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/ApiLogAspect.java
... | ... | @@ -399,7 +399,7 @@ public class ApiLogAspect { |
399 | 399 | public static void setApiLogException(ApiLog log, Exception e) { |
400 | 400 | try { |
401 | 401 | String exception = ExceptionUtils.getFullStackTrace(e); |
402 | - String shortExpInfo = e.getMessage() + "\n" + org.apache.commons.lang3.StringUtils.left(exception, 1000) + "..."; | |
402 | + String shortExpInfo = e.getMessage() + "\n" + org.apache.commons.lang3.StringUtils.left(exception, 2000) + "..."; | |
403 | 403 | log.setException(shortExpInfo); |
404 | 404 | } catch (Exception ex) { |
405 | 405 | ex.printStackTrace(); |
... | ... | @@ -409,7 +409,7 @@ public class ApiLogAspect { |
409 | 409 | public static void setApiLogThrowable(ApiLog log, Throwable e) { |
410 | 410 | try { |
411 | 411 | String exception = ExceptionUtils.getFullStackTrace(e); |
412 | - String shortExpInfo = e.getMessage() + "\n" + org.apache.commons.lang3.StringUtils.left(exception, 1000) + "..."; | |
412 | + String shortExpInfo = e.getMessage() + "\n" + org.apache.commons.lang3.StringUtils.left(exception, 2000) + "..."; | |
413 | 413 | log.setException(shortExpInfo); |
414 | 414 | } catch (Exception ex) { |
415 | 415 | ex.printStackTrace(); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/controller/HuahengBaseController.java
... | ... | @@ -73,14 +73,14 @@ public class HuahengBaseController { |
73 | 73 | log.info("[{}] 开始分布式事务 lockKey = {},获取锁耗时: {}ms", taskName, fullLockKey, endTime - startTime); |
74 | 74 | result = multiProcessListener.doProcess(); |
75 | 75 | } catch (Exception e) { |
76 | - final long finishTime = SystemClock.now(); | |
77 | - throw new RuntimeException(StrUtil.format("[{}] 执行分布式事务失败 lockKey = {},事务耗时:{}ms", taskName, fullLockKey, finishTime - endTime), e); | |
76 | + String errorMessage = StrUtil.format("[{}] 执行分布式事务失败 lockKey = {},errorMessage = {}", taskName, fullLockKey, e.getCause()); | |
77 | + log.error(errorMessage, e); | |
78 | + throw (RuntimeException)e; | |
78 | 79 | } finally { |
79 | 80 | redissonDistributedLocker.unlock(fullLockKey); |
80 | 81 | final long finishTime = SystemClock.now(); |
81 | 82 | log.info("[{}] 结束分布式事务 lockKey = {},事务耗时:{}ms", taskName, fullLockKey, finishTime - endTime); |
82 | 83 | } |
83 | - | |
84 | 84 | return result; |
85 | 85 | } |
86 | 86 | } |
... | ... |
huaheng-wms-core/src/main/resources/application-dev.yml
... | ... | @@ -191,7 +191,7 @@ jeecg: |
191 | 191 | #webapp文件路径 |
192 | 192 | webapp: /opt/webapp |
193 | 193 | shiro: |
194 | - excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/test/test**,/api/wms/** | |
194 | + excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/test/test**,/api/wms/**,/sys/cas/client/validateLogin | |
195 | 195 | #阿里云oss存储和大鱼短信秘钥配置 |
196 | 196 | oss: |
197 | 197 | accessKey: ?? |
... | ... | @@ -269,14 +269,14 @@ jeecg: |
269 | 269 | enabled: true |
270 | 270 | #cas单点登录 |
271 | 271 | cas: |
272 | - prefixUrl: http://cas.example.org:8443/cas | |
272 | + prefixUrl: http://cas.server.com:8443/cas | |
273 | 273 | #Mybatis输出sql日志 |
274 | 274 | logging: |
275 | 275 | level: |
276 | - org.jeecg.common: WARN | |
277 | - org.jeecg.modules: WARN | |
276 | + org.jeecg.common: DEBUG | |
277 | + org.jeecg.modules: DEBUG | |
278 | 278 | org.jeecg.modules.wms: DEBUG |
279 | - org.jeecg.config.shiro: INFO | |
279 | + org.jeecg.config.shiro: DEBUG | |
280 | 280 | #swagger |
281 | 281 | knife4j: |
282 | 282 | #开启增强配置 |
... | ... |
huaheng-wms-core/src/main/resources/application-prod.yml
... | ... | @@ -189,7 +189,7 @@ jeecg: |
189 | 189 | #webapp文件路径 |
190 | 190 | webapp: /opt/jeecg-boot/webapp |
191 | 191 | shiro: |
192 | - excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/test/test**,/api/wms/** | |
192 | + excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/test/test**,/api/wms/**,/sys/cas/client/validateLogin | |
193 | 193 | #阿里云oss存储和大鱼短信秘钥配置 |
194 | 194 | oss: |
195 | 195 | accessKey: ?? |
... | ... | @@ -258,7 +258,7 @@ jeecg: |
258 | 258 | enabled: true |
259 | 259 | #cas单点登录 |
260 | 260 | cas: |
261 | - prefixUrl: http://cas.example.org:8443/cas | |
261 | + prefixUrl: http://172.16.29.77:8443/cas | |
262 | 262 | #Mybatis输出sql日志 |
263 | 263 | logging: |
264 | 264 | level: |
... | ... |
huaheng-wms-core/src/main/resources/application-test.yml
... | ... | @@ -191,7 +191,7 @@ jeecg: |
191 | 191 | #webapp文件路径 |
192 | 192 | webapp: /opt/webapp |
193 | 193 | shiro: |
194 | - excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/test/test**,/api/wms/** | |
194 | + excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/test/test**,/api/wms/**,/sys/cas/client/validateLogin | |
195 | 195 | #阿里云oss存储和大鱼短信秘钥配置 |
196 | 196 | oss: |
197 | 197 | accessKey: ?? |
... | ... | @@ -270,12 +270,12 @@ jeecg: |
270 | 270 | enabled: true |
271 | 271 | #cas单点登录 |
272 | 272 | cas: |
273 | - prefixUrl: http://cas.example.org:8443/cas | |
273 | + prefixUrl: http://172.16.29.77:8443/cas | |
274 | 274 | #Mybatis输出sql日志 |
275 | 275 | logging: |
276 | 276 | level: |
277 | - org.jeecg.common: WARN | |
278 | - org.jeecg.modules: WARN | |
277 | + org.jeecg.common: DEBUG | |
278 | + org.jeecg.modules: DEBUG | |
279 | 279 | org.jeecg.modules.wms: DEBUG |
280 | 280 | org.jeecg.config.shiro: DEBUG |
281 | 281 | #swagger |
... | ... |