mirror of https://gitee.com/maxjhandsome/pig
🔖 Releasing / Version tags. 2.8.1
This commit is contained in:
parent
6e5d7ffad7
commit
9efd551e4d
|
@ -38,10 +38,11 @@ dependencies | version
|
|||
---|---
|
||||
Spring Boot | 2.3.2.RELEASE
|
||||
Spring Cloud | Hoxton.SR6
|
||||
Spring Cloud Alibaba | 2.2.1.RELEASE
|
||||
Spring Security OAuth2 | 2.3.6
|
||||
Mybatis Plus | 3.3.2
|
||||
hutool | 5.3.10
|
||||
Avue | 2.6.13
|
||||
Avue | 2.6.14
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -37,10 +37,11 @@
|
|||
---|---
|
||||
Spring Boot | 2.3.2.RELEASE
|
||||
Spring Cloud | Hoxton.SR6
|
||||
Spring Cloud Alibaba | 2.2.1.RELEASE
|
||||
Spring Security OAuth2 | 2.3.6
|
||||
Mybatis Plus | 3.3.2
|
||||
hutool | 5.3.10
|
||||
Avue | 2.6.13
|
||||
Avue | 2.6.14
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -68,8 +68,8 @@ public interface SecurityConstants {
|
|||
* sys_oauth_client_details 表的字段,不包括client_id、client_secret
|
||||
*/
|
||||
String CLIENT_FIELDS = "client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, "
|
||||
+ "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
|
||||
+ "refresh_token_validity, additional_information, autoapprove";
|
||||
+ "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
|
||||
+ "refresh_token_validity, additional_information, autoapprove";
|
||||
|
||||
/**
|
||||
* JdbcClientDetailsService 查询语句
|
||||
|
@ -115,4 +115,5 @@ public interface SecurityConstants {
|
|||
* 验证码有效期,默认 60秒
|
||||
*/
|
||||
long CODE_TIME = 60;
|
||||
|
||||
}
|
||||
|
|
|
@ -81,7 +81,8 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory {
|
|||
|
||||
// 校验验证码
|
||||
checkCode(request);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
ServerHttpResponse response = exchange.getResponse();
|
||||
response.setStatusCode(HttpStatus.PRECONDITION_REQUIRED);
|
||||
response.getHeaders().setContentType(MediaType.APPLICATION_JSON);
|
||||
|
@ -93,7 +94,8 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory {
|
|||
DataBuffer dataBuffer = response.bufferFactory().wrap(bytes);
|
||||
|
||||
monoSink.success(dataBuffer);
|
||||
} catch (JsonProcessingException jsonProcessingException) {
|
||||
}
|
||||
catch (JsonProcessingException jsonProcessingException) {
|
||||
log.error("对象输出异常", jsonProcessingException);
|
||||
monoSink.error(jsonProcessingException);
|
||||
}
|
||||
|
@ -106,7 +108,6 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory {
|
|||
|
||||
/**
|
||||
* 检查code
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
@SneakyThrows
|
||||
|
|
|
@ -39,15 +39,17 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/7/5
|
||||
* 验证码生成逻辑处理类
|
||||
* @date 2018/7/5 验证码生成逻辑处理类
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class ImageCodeHandler implements HandlerFunction<ServerResponse> {
|
||||
|
||||
private static final Integer DEFAULT_IMAGE_WIDTH = 100;
|
||||
|
||||
private static final Integer DEFAULT_IMAGE_HEIGHT = 40;
|
||||
|
||||
private final RedisTemplate redisTemplate;
|
||||
|
||||
@Override
|
||||
|
@ -56,19 +58,18 @@ public class ImageCodeHandler implements HandlerFunction<ServerResponse> {
|
|||
|
||||
String result = captcha.text();
|
||||
|
||||
//保存验证码信息
|
||||
// 保存验证码信息
|
||||
String randomStr = serverRequest.queryParam("randomStr").get();
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.opsForValue().set(CacheConstants.DEFAULT_CODE_KEY + randomStr, result
|
||||
, SecurityConstants.CODE_TIME, TimeUnit.SECONDS);
|
||||
redisTemplate.opsForValue().set(CacheConstants.DEFAULT_CODE_KEY + randomStr, result,
|
||||
SecurityConstants.CODE_TIME, TimeUnit.SECONDS);
|
||||
|
||||
// 转换流信息写出
|
||||
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
|
||||
captcha.out(os);
|
||||
|
||||
return ServerResponse
|
||||
.status(HttpStatus.OK)
|
||||
.contentType(MediaType.IMAGE_JPEG)
|
||||
return ServerResponse.status(HttpStatus.OK).contentType(MediaType.IMAGE_JPEG)
|
||||
.body(BodyInserters.fromResource(new ByteArrayResource(os.toByteArray())));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
package com.pig4cloud.pig.monitor.config;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.pig4cloud.pig.common.core.jackson.PigJavaTimeModule;
|
||||
import de.codecentric.boot.admin.server.config.AdminServerWebConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* JacksonConfig 扩展增加 spring boot 默认配置
|
||||
* <p>
|
||||
* 自身序列化机制 {@link de.codecentric.boot.admin.server.utils.jackson.AdminServerModule}
|
||||
*
|
||||
* @author lengleng
|
||||
* @date 2020-06-17
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass(ObjectMapper.class)
|
||||
@AutoConfigureAfter(AdminServerWebConfiguration.class)
|
||||
public class JacksonConfig {
|
||||
|
||||
/**
|
||||
* 覆盖core 模块提供的序列方式,增加springboot admin 序列化
|
||||
* @param adminJacksonModule spring boot admin 提供的序列化
|
||||
* @return Jackson customizer
|
||||
*/
|
||||
@Bean
|
||||
public Jackson2ObjectMapperBuilderCustomizer customizer(SimpleModule adminJacksonModule) {
|
||||
return builder -> {
|
||||
builder.locale(Locale.CHINA);
|
||||
builder.timeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|
||||
builder.simpleDateFormat(DatePattern.NORM_DATETIME_PATTERN);
|
||||
builder.modules(new PigJavaTimeModule(), adminJacksonModule);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -15,3 +15,5 @@ spring:
|
|||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
profiles:
|
||||
active: @profiles.active@
|
||||
autoconfigure:
|
||||
exclude: com.pig4cloud.pig.common.core.config.JacksonConfiguration #排除全局Jackson配置,避免admin server时间显示问题
|
||||
|
|
Loading…
Reference in New Issue