记得上下班打卡 | git大法好,push需谨慎

Commit 6cc4c219 authored by 张国柄's avatar 张国柄

fix:kylin.token验证迁移至微服务(配置启用)

parent b27fd656
...@@ -37,7 +37,7 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter { ...@@ -37,7 +37,7 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
private static final String TOKEN_KICK = "40002"; private static final String TOKEN_KICK = "40002";
private static final String TOKEN_INVALID = "40003"; private static final String TOKEN_INVALID = "40003";
private static final String KYLIN_STATION_JWT_VALID = "/kylin/station/**"; private static final String KYLIN_STATION_JWT_VALID = "/station/**";
private final static AntPathMatcher antPathMatcher = new AntPathMatcher(); private final static AntPathMatcher antPathMatcher = new AntPathMatcher();
...@@ -88,8 +88,6 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter { ...@@ -88,8 +88,6 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
if (this.authorityHandler(response, uri, token, currentUid)) { if (this.authorityHandler(response, uri, token, currentUid)) {
return true; return true;
} }
this.responseHandler(response, responseCode);
return false; return false;
} }
......
...@@ -135,3 +135,21 @@ spring: ...@@ -135,3 +135,21 @@ spring:
# ----------------------------------------------------------- # -----------------------------------------------------------
# ----------------------------------------------------------- # -----------------------------------------------------------
global-auth:
exclude-url-pattern:
- /doc.html
- /webjars/**
- /swagger-resources/**
- /v2/api-docs*
# - /login/sms
# - /login/mobile
# - /login/tpa
- /login/*
- /send
- /member/info
# -----------------------------------------------------------
# -----------------------------------------------------------
# -----------------------------------------------------------
\ No newline at end of file
...@@ -98,14 +98,19 @@ spring: ...@@ -98,14 +98,19 @@ spring:
testOnReturn: false testOnReturn: false
poolPreparedStatements: true poolPreparedStatements: true
maxOpenPreparedStatements: 20 maxOpenPreparedStatements: 20
# mvc: # -----------------------------------------------------------
# static-path-pattern: /templates/**
# # 定位模板的目录 # -----------------------------------------------------------
# view: global-auth:
# prefix: classpath:/templates/ exclude-url-pattern:
# suffix: .html - /doc.html
# resources: - /webjars/**
# static-locations: classpath:/templates/,classpath:/static/page - /swagger-resources/**
- /v2/api-docs*
- /station/login
- /station/login/sms
# -----------------------------------------------------------
# ----------------------------------------------------------- # -----------------------------------------------------------
# ----------------------------------------------------------- # -----------------------------------------------------------
...@@ -58,6 +58,7 @@ eureka: ...@@ -58,6 +58,7 @@ eureka:
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${spring.application.instance_id:${server.port}} instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${spring.application.instance_id:${server.port}}
# ----------------------------------------------------------- # -----------------------------------------------------------
zuul: zuul:
sensitive-headers:
prefix: / prefix: /
host: host:
max-per-route-connections: 300 #默认 20 max-per-route-connections: 300 #默认 20
...@@ -74,27 +75,9 @@ zuul: ...@@ -74,27 +75,9 @@ zuul:
# 忽略的接口,屏蔽接口 # 忽略的接口,屏蔽接口
# ignored-patterns: /**/div/** # ignored-patterns: /**/div/**
# ----------------------------------------------------------- # -----------------------------------------------------------
# 判断顺序: exclude.url > include.url > include.url-pattern > exclude.url-pattern
global-auth: global-auth:
include-url:
- /kylin/performance/payDetail
- /kylin/order/pre
- /kylin/order/checkPayment
- /kylin/order/details
- /kylin/order/list
- /kylin/order/payAgain
include-url-pattern:
- /kylin/station/**
- /kylin/performance/partner/**
exclude-url:
- /adam/send
- /adam/member/info
- /kylin/station/login
- /kylin/station/login/sms
exclude-url-pattern: exclude-url-pattern:
- /**/login/** - /**
- /*/v2/api-docs*
- /kylin/**
# ----------------------------------------------------------- # -----------------------------------------------------------
#解决错误 com.netflix.client.ClientException: Load balancer does not have available server for client:panfeng-item-service #解决错误 com.netflix.client.ClientException: Load balancer does not have available server for client:panfeng-item-service
#这样就可以即指定path与URL,又不破坏Zuul的Hystrix与Ribbon特性了。 #这样就可以即指定path与URL,又不破坏Zuul的Hystrix与Ribbon特性了。
......
package com.liquidnet.service.kylin.config;
import com.liquidnet.common.web.config.CorsConfig;
import org.springframework.context.annotation.Configuration;
@Configuration
public class KylinCorsConfig extends CorsConfig {
}
package com.liquidnet.service.kylin.config;
import com.liquidnet.common.web.config.WebMvcConfig;
import com.liquidnet.common.web.filter.GlobalAuthorityInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
@Configuration
public class KylinWebMvcConfig extends WebMvcConfig {
@Autowired
GlobalAuthorityInterceptor globalAuthorityInterceptor;
@Override
protected void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(globalAuthorityInterceptor).addPathPatterns("/**");
super.addInterceptors(registry);
}
}
40001=非法TOKEN
40002=被踢下线喽
40003=TOKEN失效
# ------------------------ 4开头错误码作系统保留
#APP ERROR #APP ERROR
20001=验证码发送失败 20001=验证码发送失败
20002=验证码无效 20002=验证码无效
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment