style: 替换项目内所有ruoyi转为wfc
This commit is contained in:
@@ -7,7 +7,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
/**
|
||||
* 网关启动程序
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
|
||||
public class WfcGatewayApplication
|
||||
|
||||
@@ -10,7 +10,7 @@ import static com.google.code.kaptcha.Constants.*;
|
||||
/**
|
||||
* 验证码配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Configuration
|
||||
public class CaptchaConfig
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.wfc.gateway.handler.SentinelFallbackHandler;
|
||||
/**
|
||||
* 网关限流配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Configuration
|
||||
public class GatewayConfig
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.google.code.kaptcha.text.impl.DefaultTextCreator;
|
||||
/**
|
||||
* 验证码文本生成器
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
public class KaptchaTextCreator extends DefaultTextCreator
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.wfc.gateway.handler.ValidateCodeHandler;
|
||||
/**
|
||||
* 路由配置信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Configuration
|
||||
public class RouterFunctionConfiguration
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* SpringDoc配置类
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnProperty(value = "springdoc.api-docs.enabled", matchIfMissing = true)
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
/**
|
||||
* 验证码配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Configuration
|
||||
@RefreshScope
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
/**
|
||||
* 放行白名单配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Configuration
|
||||
@RefreshScope
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
/**
|
||||
* XSS跨站脚本配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Configuration
|
||||
@RefreshScope
|
||||
|
||||
@@ -24,7 +24,7 @@ import reactor.core.publisher.Mono;
|
||||
/**
|
||||
* 网关鉴权
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Component
|
||||
public class AuthFilter implements GlobalFilter, Ordered
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.wfc.common.core.utils.ServletUtils;
|
||||
/**
|
||||
* 黑名单过滤器
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Component
|
||||
public class BlackListUrlFilter extends AbstractGatewayFilterFactory<BlackListUrlFilter.Config>
|
||||
|
||||
@@ -15,7 +15,7 @@ import reactor.core.publisher.Mono;
|
||||
/**
|
||||
* 获取body请求数据(解决流不能重复读取问题)
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Component
|
||||
public class CacheRequestFilter extends AbstractGatewayFilterFactory<CacheRequestFilter.Config>
|
||||
|
||||
@@ -21,7 +21,7 @@ import reactor.core.publisher.Flux;
|
||||
/**
|
||||
* 验证码过滤器
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Component
|
||||
public class ValidateCodeFilter extends AbstractGatewayFilterFactory<Object>
|
||||
|
||||
@@ -28,7 +28,7 @@ import reactor.core.publisher.Mono;
|
||||
/**
|
||||
* 跨站脚本过滤器
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Component
|
||||
@ConditionalOnProperty(value = "security.xss.enabled", havingValue = "true")
|
||||
|
||||
@@ -15,7 +15,7 @@ import reactor.core.publisher.Mono;
|
||||
/**
|
||||
* 网关统一异常处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Order(-1)
|
||||
@Configuration
|
||||
|
||||
@@ -11,7 +11,7 @@ import reactor.core.publisher.Mono;
|
||||
/**
|
||||
* 自定义限流异常处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
public class SentinelFallbackHandler implements WebExceptionHandler
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ import reactor.core.publisher.Mono;
|
||||
/**
|
||||
* 验证码获取
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Component
|
||||
public class ValidateCodeHandler implements HandlerFunction<ServerResponse>
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.wfc.common.core.web.domain.AjaxResult;
|
||||
/**
|
||||
* 验证码处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
public interface ValidateCodeService
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.wfc.gateway.service.impl;
|
||||
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.FastByteArrayOutputStream;
|
||||
import org.wfc.common.core.constant.CacheConstants;
|
||||
@@ -26,7 +27,7 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* 验证码实现处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author wfc
|
||||
*/
|
||||
@Service
|
||||
public class ValidateCodeServiceImpl implements ValidateCodeService
|
||||
@@ -37,6 +38,9 @@ public class ValidateCodeServiceImpl implements ValidateCodeService
|
||||
@Resource(name = "captchaProducerMath")
|
||||
private Producer captchaProducerMath;
|
||||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String springProfilesActive;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@@ -94,6 +98,9 @@ public class ValidateCodeServiceImpl implements ValidateCodeService
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("uuid", uuid);
|
||||
data.put("img", Base64.encode(os.toByteArray()));
|
||||
if ("dev".equals(springProfilesActive)) {
|
||||
data.put("text", code);
|
||||
}
|
||||
|
||||
return AjaxResult.success(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user