mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:集成Minio
This commit is contained in:
@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 网关服务启动类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-27
|
||||
* @date 2020-10-19
|
||||
*/
|
||||
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
|
||||
@SpringCloudApplication
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
* 网关业务配置类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-27
|
||||
* @date 2020-10-19
|
||||
*/
|
||||
@Data
|
||||
@RefreshScope
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.springframework.web.util.pattern.PathPatternParser;
|
||||
* 跨域信任配置类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-27
|
||||
* @date 2020-10-19
|
||||
*/
|
||||
@Configuration
|
||||
public class CorsConfig {
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.nio.charset.StandardCharsets;
|
||||
* Web通用过滤器配置类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-27
|
||||
* @date 2020-10-19
|
||||
*/
|
||||
@Configuration
|
||||
public class FilterConfig {
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.*;
|
||||
* Spring Cloud Gateway的Sentinel流控配置类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-27
|
||||
* @date 2020-10-19
|
||||
*/
|
||||
@Configuration
|
||||
public class SentinelConfig {
|
||||
|
||||
@@ -4,7 +4,7 @@ package com.orange.demo.gateway.constant;
|
||||
* 网关业务相关的常量对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-27
|
||||
* @date 2020-10-19
|
||||
*/
|
||||
public final class GatewayConstant {
|
||||
|
||||
@@ -16,12 +16,12 @@ public final class GatewayConstant {
|
||||
/**
|
||||
* 登录URL。
|
||||
*/
|
||||
public static final String ADMIN_LOGIN_URL = "/admin/login/doLogin";
|
||||
public static final String ADMIN_LOGIN_URL = "/admin/upms/login/doLogin";
|
||||
|
||||
/**
|
||||
* 登出URL。
|
||||
*/
|
||||
public static final String ADMIN_LOGOUT_URL = "/admin/login/doLogout";
|
||||
public static final String ADMIN_LOGOUT_URL = "/admin/upms/login/doLogout";
|
||||
|
||||
/**
|
||||
* sessionId的键名称。
|
||||
|
||||
@@ -46,7 +46,7 @@ import java.util.Map;
|
||||
* 全局后处理过滤器。主要用于将用户的会话信息存到缓存服务器,以及在登出时清除缓存中的会话数据。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-27
|
||||
* @date 2020-10-19
|
||||
*/
|
||||
@Slf4j
|
||||
public class AuthenticationPostFilter implements GlobalFilter, Ordered {
|
||||
|
||||
@@ -38,7 +38,7 @@ import java.util.Map;
|
||||
* 全局前处理过滤器。主要用于用户操作权限验证。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-27
|
||||
* @date 2020-10-19
|
||||
*/
|
||||
@Slf4j
|
||||
public class AuthenticationPreFilter implements GlobalFilter, Ordered {
|
||||
@@ -70,7 +70,7 @@ public class AuthenticationPreFilter implements GlobalFilter, Ordered {
|
||||
response.setStatusCode(HttpStatus.UNAUTHORIZED);
|
||||
response.getHeaders().setContentType(MediaType.APPLICATION_JSON);
|
||||
byte[] responseBody = JSON.toJSONString(ResponseResult.error(ErrorCodeEnum.UNAUTHORIZED_LOGIN,
|
||||
"用户登录已过期,请重新登录!")).getBytes(StandardCharsets.UTF_8);
|
||||
"用户登录已过期或尚未登录,请重新登录!")).getBytes(StandardCharsets.UTF_8);
|
||||
return response.writeWith(Flux.just(response.bufferFactory().wrap(responseBody)));
|
||||
}
|
||||
// 这里判断是否需要定时刷新token
|
||||
|
||||
@@ -17,7 +17,7 @@ import reactor.core.publisher.Mono;
|
||||
* 为整个链路生成唯一的traceId,并存储在Request Head中。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-27
|
||||
* @date 2020-10-19
|
||||
*/
|
||||
@Slf4j
|
||||
public class RequestLogFilter implements GlobalFilter, Ordered {
|
||||
|
||||
@@ -16,7 +16,7 @@ import reactor.core.publisher.Mono;
|
||||
* 将整个链路的traceId存储在Response Head中,并返回给前端,便于问题定位。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-09-27
|
||||
* @date 2020-10-19
|
||||
*/
|
||||
@Slf4j
|
||||
public class ResponseLogFilter implements GlobalFilter, Ordered {
|
||||
|
||||
Reference in New Issue
Block a user