添加会员注册功能路由以及相关配置
This commit is contained in:
+13
@@ -192,6 +192,19 @@ public class SystemRouter {
|
|||||||
.POST("/api/permissions", permissionHandler::createPermission)
|
.POST("/api/permissions", permissionHandler::createPermission)
|
||||||
.PUT("/api/permissions/{id}", permissionHandler::updatePermission)
|
.PUT("/api/permissions/{id}", permissionHandler::updatePermission)
|
||||||
.DELETE("/api/permissions/{id}", permissionHandler::deletePermission)
|
.DELETE("/api/permissions/{id}", permissionHandler::deletePermission)
|
||||||
|
|
||||||
|
// ========== 会员模块路由 - 微信认证 ==========
|
||||||
|
.POST("/api/member/auth/miniapp/login", wechatAuthHandler::miniappLogin)
|
||||||
|
.GET("/api/member/auth/mp/callback", wechatAuthHandler::verifyMpSignature)
|
||||||
|
.POST("/api/member/auth/mp/callback", wechatAuthHandler::mpCallback)
|
||||||
|
|
||||||
|
// ========== 会员模块路由 - 会员信息 ==========
|
||||||
|
.GET("/api/member/info", memberHandler::getMemberInfo)
|
||||||
|
.POST("/api/member/phone/bind", memberHandler::bindPhone)
|
||||||
|
.GET("/api/member/subscribe/status", memberHandler::checkSubscribeStatus)
|
||||||
|
|
||||||
|
// ========== 会员模块路由 - 管理端 ==========
|
||||||
|
.POST("/api/admin/members/{id}/phone", memberHandler::adminUpdatePhone)
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -47,6 +47,7 @@ public class JwtAuthenticationFilter extends AbstractGatewayFilterFactory<JwtAut
|
|||||||
|
|
||||||
ServerHttpRequest modifiedRequest = request.mutate()
|
ServerHttpRequest modifiedRequest = request.mutate()
|
||||||
.header("X-User-Id", String.valueOf(userId))
|
.header("X-User-Id", String.valueOf(userId))
|
||||||
|
.header("X-Member-Id", String.valueOf(userId))
|
||||||
.header("X-Username", username)
|
.header("X-Username", username)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@@ -57,7 +58,11 @@ public class JwtAuthenticationFilter extends AbstractGatewayFilterFactory<JwtAut
|
|||||||
private boolean isPublicPath(String path) {
|
private boolean isPublicPath(String path) {
|
||||||
return path.startsWith("/api/auth/") ||
|
return path.startsWith("/api/auth/") ||
|
||||||
path.equals("/actuator/health") ||
|
path.equals("/actuator/health") ||
|
||||||
path.startsWith("/actuator/info");
|
path.startsWith("/actuator/info") ||
|
||||||
|
path.equals("/api/member/auth/miniapp/login") ||
|
||||||
|
path.equals("/api/member/auth/mp/callback") ||
|
||||||
|
path.equals("/api/auth/login") ||
|
||||||
|
path.startsWith("/actuator/info");;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Config {
|
public static class Config {
|
||||||
|
|||||||
@@ -9,27 +9,27 @@ spring:
|
|||||||
cloud:
|
cloud:
|
||||||
gateway:
|
gateway:
|
||||||
routes:
|
routes:
|
||||||
- id: manage-app
|
- id: manage-app
|
||||||
uri: http://localhost:8084
|
uri: http://localhost:8084
|
||||||
predicates:
|
predicates:
|
||||||
- Path=/api/**
|
- Path=/api/**
|
||||||
default-filters:
|
default-filters:
|
||||||
- name: JwtAuthentication
|
- name: JwtAuthentication
|
||||||
- name: RbacAuthorization
|
- name: RbacAuthorization
|
||||||
- name: Retry
|
- name: Retry
|
||||||
args:
|
args:
|
||||||
retries: 3
|
retries: 3
|
||||||
statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
|
statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
|
||||||
methods: GET,POST
|
methods: GET,POST
|
||||||
backoff:
|
backoff:
|
||||||
firstBackoff: 10ms
|
firstBackoff: 10ms
|
||||||
maxBackoff: 50ms
|
maxBackoff: 50ms
|
||||||
factor: 2
|
factor: 2
|
||||||
basedOnPreviousValue: false
|
basedOnPreviousValue: false
|
||||||
- name: DedupeResponseHeader
|
- name: DedupeResponseHeader
|
||||||
args:
|
args:
|
||||||
name: Content-Encoding
|
name: Content-Encoding
|
||||||
strategy: RETAIN_FIRST
|
strategy: RETAIN_FIRST
|
||||||
|
|
||||||
jwt:
|
jwt:
|
||||||
secret: ${JWT_SECRET:enc:U2FsdGVkX1+vZ5Y9QmKxL8nN3rP7tW2jH4fG6dA8sB1cE5yN0zX3qV7wM4}
|
secret: ${JWT_SECRET:enc:U2FsdGVkX1+vZ5Y9QmKxL8nN3rP7tW2jH4fG6dA8sB1cE5yN0zX3qV7wM4}
|
||||||
@@ -64,7 +64,7 @@ signature:
|
|||||||
max-age-minutes: ${SIGNATURE_MAX_AGE_MINUTES:5}
|
max-age-minutes: ${SIGNATURE_MAX_AGE_MINUTES:5}
|
||||||
nonce-cache-size: ${SIGNATURE_NONCE_CACHE_SIZE:10000}
|
nonce-cache-size: ${SIGNATURE_NONCE_CACHE_SIZE:10000}
|
||||||
whitelist:
|
whitelist:
|
||||||
paths: ${SIGNATURE_WHITELIST_PATHS:/actuator/health,/actuator/info,/api/auth/login}
|
paths: ${SIGNATURE_WHITELIST_PATHS:/actuator/health,/actuator/info,/api/auth/login,/api/auth/register,/api/member/auth/miniapp/login,/api/member/auth/mp/callback}
|
||||||
|
|
||||||
resilience:
|
resilience:
|
||||||
enabled: ${RESILIENCE_ENABLED:true}
|
enabled: ${RESILIENCE_ENABLED:true}
|
||||||
|
|||||||
Reference in New Issue
Block a user