优化
This commit is contained in:
+2
@@ -28,6 +28,7 @@ public class FeignInterceptorConfig {
|
|||||||
RequestInterceptor requestInterceptor = template -> {
|
RequestInterceptor requestInterceptor = template -> {
|
||||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
|
||||||
.getRequestAttributes();
|
.getRequestAttributes();
|
||||||
|
if (attributes != null) {
|
||||||
HttpServletRequest request = attributes.getRequest();
|
HttpServletRequest request = attributes.getRequest();
|
||||||
|
|
||||||
//传递access_token,无网络隔离时需要传递
|
//传递access_token,无网络隔离时需要传递
|
||||||
@@ -70,6 +71,7 @@ public class FeignInterceptorConfig {
|
|||||||
if (StrUtil.isNotEmpty(traceId)) {
|
if (StrUtil.isNotEmpty(traceId)) {
|
||||||
template.header(CommonConstant.TRACE_ID_HEADER, traceId);
|
template.header(CommonConstant.TRACE_ID_HEADER, traceId);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
return requestInterceptor;
|
return requestInterceptor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
########################## 统一变量配置 ##########################
|
########################## 统一变量配置 ##########################
|
||||||
##### 数据库配置
|
##### 数据库配置
|
||||||
zlt.datasource.ip=192.168.28.131
|
zlt.datasource.ip=192.168.28.130
|
||||||
zlt.datasource.username=root
|
zlt.datasource.username=root
|
||||||
zlt.datasource.password=1q2w3e4r
|
zlt.datasource.password=1q2w3e4r
|
||||||
|
|
||||||
|
|||||||
@@ -202,7 +202,6 @@ INSERT INTO `sys_role_menu` VALUES (3, 2);
|
|||||||
INSERT INTO `sys_role_menu` VALUES (3, 3);
|
INSERT INTO `sys_role_menu` VALUES (3, 3);
|
||||||
INSERT INTO `sys_role_menu` VALUES (3, 4);
|
INSERT INTO `sys_role_menu` VALUES (3, 4);
|
||||||
INSERT INTO `sys_role_menu` VALUES (3, 12);
|
INSERT INTO `sys_role_menu` VALUES (3, 12);
|
||||||
INSERT INTO `sys_role_menu` VALUES (3, 12);
|
|
||||||
INSERT INTO `sys_role_menu` VALUES (4, 80);
|
INSERT INTO `sys_role_menu` VALUES (4, 80);
|
||||||
INSERT INTO `sys_role_menu` VALUES (4, 81);
|
INSERT INTO `sys_role_menu` VALUES (4, 81);
|
||||||
INSERT INTO `sys_role_menu` VALUES (4, 82);
|
INSERT INTO `sys_role_menu` VALUES (4, 82);
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ spring:
|
|||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
rule-type: gw-api-group
|
rule-type: gw-api-group
|
||||||
|
|
||||||
|
security:
|
||||||
|
sessions: ALWAYS
|
||||||
|
|
||||||
|
|
||||||
zlt:
|
zlt:
|
||||||
oauth2:
|
oauth2:
|
||||||
token:
|
token:
|
||||||
@@ -35,6 +39,7 @@ zlt:
|
|||||||
ignore:
|
ignore:
|
||||||
# 忽略认证的地址
|
# 忽略认证的地址
|
||||||
httpUrls: >
|
httpUrls: >
|
||||||
|
/api-user/test,
|
||||||
/api-uaa/oauth/**,
|
/api-uaa/oauth/**,
|
||||||
/api-uaa/validata/**,
|
/api-uaa/validata/**,
|
||||||
/api-uaa/css/**,
|
/api-uaa/css/**,
|
||||||
@@ -61,6 +66,10 @@ zlt:
|
|||||||
#白名单
|
#白名单
|
||||||
includeClientIds:
|
includeClientIds:
|
||||||
- webApp
|
- webApp
|
||||||
|
gateway:
|
||||||
|
#网关动态路由
|
||||||
|
dynamicRoute:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
|
||||||
zuul:
|
zuul:
|
||||||
@@ -73,8 +82,6 @@ zuul:
|
|||||||
threadPoolKeyPrefix: api-gateway
|
threadPoolKeyPrefix: api-gateway
|
||||||
#关闭重试
|
#关闭重试
|
||||||
retryable: false
|
retryable: false
|
||||||
#/oauth/token需要请求头处理
|
|
||||||
sensitive-headers:
|
|
||||||
ignored-headers: Access-Control-Allow-Credentials,Access-Control-Allow-Origin,Access-Control-Allow-Methods
|
ignored-headers: Access-Control-Allow-Credentials,Access-Control-Allow-Origin,Access-Control-Allow-Methods
|
||||||
add-host-header: true
|
add-host-header: true
|
||||||
routes:
|
routes:
|
||||||
@@ -82,53 +89,67 @@ zuul:
|
|||||||
path: /api-uaa/**
|
path: /api-uaa/**
|
||||||
service-id: uaa-server
|
service-id: uaa-server
|
||||||
strip-prefix: true
|
strip-prefix: true
|
||||||
|
sensitive-headers: '*'
|
||||||
custom-sensitive-headers: true
|
custom-sensitive-headers: true
|
||||||
auth-login-page:
|
auth-login-page:
|
||||||
path: /login.html
|
path: /login.html
|
||||||
service-id: uaa-server
|
service-id: uaa-server
|
||||||
strip-prefix: true
|
strip-prefix: true
|
||||||
|
sensitive-headers: '*'
|
||||||
custom-sensitive-headers: true
|
custom-sensitive-headers: true
|
||||||
auth-login-process:
|
auth-login-process:
|
||||||
path: /user/login
|
path: /user/login
|
||||||
service-id: uaa-server
|
service-id: uaa-server
|
||||||
strip-prefix: true
|
strip-prefix: true
|
||||||
|
sensitive-headers: '*'
|
||||||
custom-sensitive-headers: true
|
custom-sensitive-headers: true
|
||||||
auth-login-token:
|
auth-login-token:
|
||||||
path: /oauth/token
|
path: /oauth/token
|
||||||
service-id: uaa-server
|
service-id: uaa-server
|
||||||
strip-prefix: true
|
strip-prefix: true
|
||||||
|
sensitive-headers: '*'
|
||||||
custom-sensitive-headers: true
|
custom-sensitive-headers: true
|
||||||
auth-login-authorize:
|
auth-login-authorize:
|
||||||
path: /oauth/authorize
|
path: /oauth/authorize
|
||||||
service-id: uaa-server
|
service-id: uaa-server
|
||||||
strip-prefix: true
|
strip-prefix: true
|
||||||
|
sensitive-headers: '*'
|
||||||
custom-sensitive-headers: true
|
custom-sensitive-headers: true
|
||||||
auth-check-process:
|
auth-check-process:
|
||||||
path: /oauth/check_token
|
path: /oauth/check_token
|
||||||
service-id: uaa-server
|
service-id: uaa-server
|
||||||
strip-prefix: true
|
strip-prefix: true
|
||||||
|
sensitive-headers: '*'
|
||||||
custom-sensitive-headers: true
|
custom-sensitive-headers: true
|
||||||
user:
|
user:
|
||||||
path: /api-user/**
|
path: /api-user/**
|
||||||
service-id: user-center
|
service-id: user-center
|
||||||
strip-prefix: true
|
strip-prefix: true
|
||||||
|
sensitive-headers: '*'
|
||||||
custom-sensitive-headers: true
|
custom-sensitive-headers: true
|
||||||
file:
|
file:
|
||||||
path: /api-file/**
|
path: /api-file/**
|
||||||
service-id: file-center
|
service-id: file-center
|
||||||
strip-prefix: true
|
strip-prefix: true
|
||||||
|
sensitive-headers: '*'
|
||||||
|
custom-sensitive-headers: true
|
||||||
log:
|
log:
|
||||||
path: /api-log/**
|
path: /api-log/**
|
||||||
service-id: log-center
|
service-id: log-center
|
||||||
strip-prefix: true
|
strip-prefix: true
|
||||||
|
sensitive-headers: '*'
|
||||||
|
custom-sensitive-headers: true
|
||||||
generator:
|
generator:
|
||||||
path: /api-generator/**
|
path: /api-generator/**
|
||||||
service-id: code-generator
|
service-id: code-generator
|
||||||
strip-prefix: true
|
strip-prefix: true
|
||||||
|
sensitive-headers: '*'
|
||||||
|
custom-sensitive-headers: true
|
||||||
search:
|
search:
|
||||||
path: /api-search/**
|
path: /api-search/**
|
||||||
service-id: search-center
|
service-id: search-center
|
||||||
strip-prefix: true
|
strip-prefix: true
|
||||||
|
sensitive-headers: '*'
|
||||||
custom-sensitive-headers: true
|
custom-sensitive-headers: true
|
||||||
ssl-hostname-validation-enabled: false
|
ssl-hostname-validation-enabled: false
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,9 @@
|
|||||||
layer.load(2);
|
layer.load(2);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: config.base_server + 'api-uaa/oauth/user/token',
|
url: config.base_server + 'api-uaa/oauth/user/token',
|
||||||
|
xhrFields: {
|
||||||
|
withCredentials: true
|
||||||
|
},
|
||||||
data: obj.field,
|
data: obj.field,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
beforeSend: function (xhr) {
|
beforeSend: function (xhr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user