Skip to content

Commit

Permalink
2.6.9.c
Browse files Browse the repository at this point in the history
  • Loading branch information
pkaq committed Aug 12, 2021
1 parent 741303f commit f18d2ba
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 170 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ext {
allprojects {
apply plugin: "idea"
group = 'io.nerv'
version = '2.6.9.a'
version = '2.6.9.c'
}

subprojects {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public JwtAuthFilter authenticationTokenFilterBean() {
return new JwtAuthFilter();
}

/**
* 跨域配置
* @return
*/
@Bean
CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package io.nerv.core.advice;

import io.nerv.core.enums.BizCode;
import io.nerv.core.enums.BizCodeEnum;
import io.nerv.core.mvc.vo.Response;
import org.springframework.core.MethodParameter;
import org.springframework.http.MediaType;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;

/**
* 统一处理返回值
* 注意 这里只对io.nerv包下的返回值自动响应处理
*/
@RestControllerAdvice(basePackages = "io.nerv")
public class CommonResponseAdvice implements ResponseBodyAdvice {

@Override
public boolean supports(MethodParameter returnType, Class converterType) {
return true;
}

@Override
public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType, Class selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) {


if (body instanceof Response){
return body;
}
Response res = new Response();
res.setSuccess(true);

if (body instanceof BizCode){
res.setCode(((BizCode) body).getIndex());
res.setMessage(((BizCode) body).getName());
} else {
res.setMessage(BizCodeEnum.OPERATE_SUCCESS.getIndex());
res.setData(body);
}

return res;
}
}
22 changes: 11 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ profile=aliyun

spring_dep=1.0.11.RELEASE
jfrog_ver=1.8.5
spring_boot_ver=2.5.2
mysql=8.0.25
mybatis_plus_starter=3.4.3
spring_boot_ver=2.5.3
mysql=8.0.26
mybatis_plus_starter=3.4.3.1
mybatis_plus_generator=3.5.0
lombok=1.18.20
knife4j=3.0.2
hutool=5.7.3
knife4j=3.0.3
hutool=5.7.7
jaxb_api=2.3.1
jasypt=3.0.3
p6spy=3.9.1
flyway=7.9.1
flyway=7.11.4
boot_admin=2.4.3
truelicense=1.33
caffeine=3.0.3
weixin=4.0.0
weixin=4.1.0
securityTest=5.5.1
alipay=4.13.58.ALL
alipay=4.16.1.ALL
zxing=3.4.1
velocity=2.3
jwt=9.9.3
jwt=9.11.2
jsr310=2.12.1
oracle=19.10.0.0
oracle=19.11.0.0
orai18n=12.1.0.2.0
snakeyaml=1.29
cdu=1.4.0
cdu=1.4.1

org.gradle.jvmargs=-Dfile.encoding=UTF-8
systemProp.file.encoding=UTF-8
Expand Down
4 changes: 3 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ include ':eva-core:eva-core-cache'
include ':eva-core:eva-core-data-jpa'
include ':eva-core:eva-core-data-mybatis'
include ':eva-core:eva-core-security'
include 'eva-core:eva-core-sso'

include 'nerv-admin-server'
include 'nerv-license'
include 'nerv-generator'
include 'web-booter'

include 'web-booter-sso'
2 changes: 1 addition & 1 deletion web-booter/src/main/resources/application-aliyun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spring:
additional-paths: src/main/java
# redis 配置
redis:
host: xilai.my.to
host: 47.104.217.77
port: 6379
password: 7u8i9o0p
timeout: 10000
Expand Down

0 comments on commit f18d2ba

Please sign in to comment.