Commit 113e295f authored by 赵啸非's avatar 赵啸非

添加网关验证码验证

parent ca115ca5
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: antlr:antlr:2.7.7"> <library name="Maven: cn.hutool:hutool-all:5.7.14">
<CLASSES> <CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/antlr/antlr/2.7.7/antlr-2.7.7.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/cn/hutool/hutool-all/5.7.14/hutool-all-5.7.14.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/antlr/antlr/2.7.7/antlr-2.7.7-javadoc.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/cn/hutool/hutool-all/5.7.14/hutool-all-5.7.14-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/antlr/antlr/2.7.7/antlr-2.7.7-sources.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/cn/hutool/hutool-all/5.7.14/hutool-all-5.7.14-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.sun.activation:jakarta.activation:1.2.2">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/com/sun/activation/jakarta.activation/1.2.2/jakarta.activation-1.2.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/com/sun/activation/jakarta.activation/1.2.2/jakarta.activation-1.2.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/com/sun/activation/jakarta.activation/1.2.2/jakarta.activation-1.2.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.sun.istack:istack-commons-runtime:3.0.11">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/com/sun/istack/istack-commons-runtime/3.0.11/istack-commons-runtime-3.0.11.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/com/sun/istack/istack-commons-runtime/3.0.11/istack-commons-runtime-3.0.11-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/com/sun/istack/istack-commons-runtime/3.0.11/istack-commons-runtime-3.0.11-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: org.jboss:jandex:2.1.3.Final"> <library name="Maven: io.reactivex.rxjava3:rxjava:3.0.12">
<CLASSES> <CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/jboss/jandex/2.1.3.Final/jandex-2.1.3.Final.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/io/reactivex/rxjava3/rxjava/3.0.12/rxjava-3.0.12.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/jboss/jandex/2.1.3.Final/jandex-2.1.3.Final-javadoc.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/io/reactivex/rxjava3/rxjava/3.0.12/rxjava-3.0.12-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/jboss/jandex/2.1.3.Final/jandex-2.1.3.Final-sources.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/io/reactivex/rxjava3/rxjava/3.0.12/rxjava-3.0.12-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: jakarta.persistence:jakarta.persistence-api:2.2.3">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: jakarta.transaction:jakarta.transaction-api:1.3.3">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.glassfish.jaxb:txw2:2.3.3">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/glassfish/jaxb/txw2/2.3.3/txw2-2.3.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/glassfish/jaxb/txw2/2.3.3/txw2-2.3.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/glassfish/jaxb/txw2/2.3.3/txw2-2.3.3-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.hibernate.common:hibernate-commons-annotations:5.1.2.Final">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/hibernate/common/hibernate-commons-annotations/5.1.2.Final/hibernate-commons-annotations-5.1.2.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/hibernate/common/hibernate-commons-annotations/5.1.2.Final/hibernate-commons-annotations-5.1.2.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/hibernate/common/hibernate-commons-annotations/5.1.2.Final/hibernate-commons-annotations-5.1.2.Final-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.hibernate:hibernate-core:5.4.27.Final">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/hibernate/hibernate-core/5.4.27.Final/hibernate-core-5.4.27.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/hibernate/hibernate-core/5.4.27.Final/hibernate-core-5.4.27.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/hibernate/hibernate-core/5.4.27.Final/hibernate-core-5.4.27.Final-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: org.javassist:javassist:3.27.0-GA"> <library name="Maven: org.javassist:javassist:3.25.0-GA">
<CLASSES> <CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/javassist/javassist/3.27.0-GA/javassist-3.27.0-GA.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/javassist/javassist/3.25.0-GA/javassist-3.25.0-GA.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/javassist/javassist/3.27.0-GA/javassist-3.27.0-GA-javadoc.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/javassist/javassist/3.25.0-GA/javassist-3.25.0-GA-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/javassist/javassist/3.27.0-GA/javassist-3.27.0-GA-sources.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/javassist/javassist/3.25.0-GA/javassist-3.25.0-GA-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:2.3.8.RELEASE">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/boot/spring-boot-starter-data-jpa/2.3.8.RELEASE/spring-boot-starter-data-jpa-2.3.8.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/boot/spring-boot-starter-data-jpa/2.3.8.RELEASE/spring-boot-starter-data-jpa-2.3.8.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/boot/spring-boot-starter-data-jpa/2.3.8.RELEASE/spring-boot-starter-data-jpa-2.3.8.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: org.springframework.cloud:spring-cloud-starter-gateway:3.1.3"> <library name="Maven: org.springframework.cloud:spring-cloud-starter-gateway:2.2.7.RELEASE">
<CLASSES> <CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/cloud/spring-cloud-starter-gateway/3.1.3/spring-cloud-starter-gateway-3.1.3.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/cloud/spring-cloud-starter-gateway/2.2.7.RELEASE/spring-cloud-starter-gateway-2.2.7.RELEASE.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/cloud/spring-cloud-starter-gateway/3.1.3/spring-cloud-starter-gateway-3.1.3-javadoc.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/cloud/spring-cloud-starter-gateway/2.2.7.RELEASE/spring-cloud-starter-gateway-2.2.7.RELEASE-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/cloud/spring-cloud-starter-gateway/3.1.3/spring-cloud-starter-gateway-3.1.3-sources.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/cloud/spring-cloud-starter-gateway/2.2.7.RELEASE/spring-cloud-starter-gateway-2.2.7.RELEASE-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework.data:spring-data-jpa:2.3.6.RELEASE">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/data/spring-data-jpa/2.3.6.RELEASE/spring-data-jpa-2.3.6.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/data/spring-data-jpa/2.3.6.RELEASE/spring-data-jpa-2.3.6.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/data/spring-data-jpa/2.3.6.RELEASE/spring-data-jpa-2.3.6.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-orm:5.2.12.RELEASE">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-orm/5.2.12.RELEASE/spring-orm-5.2.12.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-orm/5.2.12.RELEASE/spring-orm-5.2.12.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-orm/5.2.12.RELEASE/spring-orm-5.2.12.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: org.glassfish.jaxb:jaxb-runtime:2.3.3"> <library name="Maven: org.springframework:spring-test:5.3.21">
<CLASSES> <CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/glassfish/jaxb/jaxb-runtime/2.3.3/jaxb-runtime-2.3.3.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-test/5.3.21/spring-test-5.3.21.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/glassfish/jaxb/jaxb-runtime/2.3.3/jaxb-runtime-2.3.3-javadoc.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-test/5.3.21/spring-test-5.3.21-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/glassfish/jaxb/jaxb-runtime/2.3.3/jaxb-runtime-2.3.3-sources.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-test/5.3.21/spring-test-5.3.21-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>
\ No newline at end of file
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: org.springframework:spring-aspects:5.2.12.RELEASE"> <library name="Maven: org.springframework:spring-webflux:5.2.12.RELEASE">
<CLASSES> <CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-aspects/5.2.12.RELEASE/spring-aspects-5.2.12.RELEASE.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-webflux/5.2.12.RELEASE/spring-webflux-5.2.12.RELEASE.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-aspects/5.2.12.RELEASE/spring-aspects-5.2.12.RELEASE-javadoc.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-webflux/5.2.12.RELEASE/spring-webflux-5.2.12.RELEASE-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-aspects/5.2.12.RELEASE/spring-aspects-5.2.12.RELEASE-sources.jar!/" /> <root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-webflux/5.2.12.RELEASE/spring-webflux-5.2.12.RELEASE-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-webflux:5.3.18">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-webflux/5.3.18/spring-webflux-5.3.18.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-webflux/5.3.18/spring-webflux-5.3.18-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../MavenRepository/maven_jar/org/springframework/spring-webflux/5.3.18/spring-webflux-5.3.18-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
...@@ -23,7 +23,7 @@ import java.io.IOException; ...@@ -23,7 +23,7 @@ import java.io.IOException;
* @author: zxfei * @author: zxfei
* @date: 2022/4/20 14:52 * @date: 2022/4/20 14:52
*/ */
@Component //@Component
@Slf4j @Slf4j
public class RequestFilter extends OncePerRequestFilter implements Filter { public class RequestFilter extends OncePerRequestFilter implements Filter {
......
{ {
"base-local": { "base-local": {
"baseUrl": "http://127.0.0.1:17211/zwfw" "baseUrl": "http://127.0.0.1:17231/base"
}, },
"base-dev": { "base-dev": {
"baseUrl": "http://192.168.0.217:17311/zwfw" "baseUrl": "http://192.168.0.217:17211/base"
}, },
"base-test": { "base-test": {
"baseUrl": "http://192.168.0.98:11071/zwfw" "baseUrl": "http://192.168.0.98:11071/zwfw"
......
...@@ -5,8 +5,6 @@ Authorization: {{authToken}} ...@@ -5,8 +5,6 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"siteName":"测试站点",
"areaID":"a9pbna",
"page":1, "page":1,
"size":10 "size":10
} }
......
...@@ -31,7 +31,7 @@ Accept: application/json ...@@ -31,7 +31,7 @@ Accept: application/json
###解析token ###解析token
POST {{baseUrl}}/login/parseToken POST {{baseUrl}}/login/parseToken
Content-Type: application/json Content-Type: application/json
Authorization: Bearer {{authToken}} Authorization: {{authToken}}
###短信设置删除 ###短信设置删除
GET {{baseUrl}}/sms/set/delete?id={{SmsSet_id}} GET {{baseUrl}}/sms/set/delete?id={{SmsSet_id}}
......
...@@ -52,12 +52,6 @@ ...@@ -52,12 +52,6 @@
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.6.2</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.kafka</groupId> <groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId> <artifactId>kafka-clients</artifactId>
......
package com.mortals.xhx.feign.req; package com.mortals.xhx.feign.req;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
......
...@@ -119,8 +119,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -119,8 +119,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
this.init(model, context); this.init(model, context);
ret.setCode(code); ret.setCode(code);
ret.setData(model); ret.setData(model);
ret.setDict((Map<String, Object>) model.remove(KEY_RESULT_DICT)); ret.setDict(model.get(KEY_RESULT_DICT)==null?null:(Map<String,Object>)model.remove(KEY_RESULT_DICT));
ret.setMsg(model.remove(MESSAGE_INFO).toString()); ret.setMsg(model.get(MESSAGE_INFO)==null?"":model.remove(MESSAGE_INFO).toString());
return ret; return ret;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -2,6 +2,7 @@ package com.mortals.xhx; ...@@ -2,6 +2,7 @@ package com.mortals.xhx;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
...@@ -10,9 +11,9 @@ import org.springframework.context.annotation.ImportResource; ...@@ -10,9 +11,9 @@ import org.springframework.context.annotation.ImportResource;
import com.mortals.framework.springcloud.boot.BaseWebApplication; import com.mortals.framework.springcloud.boot.BaseWebApplication;
@EnableFeignClients @EnableFeignClients
@SpringBootApplication(scanBasePackages = { "com.mortals" }) @SpringBootApplication(exclude= {DataSourceAutoConfiguration.class},scanBasePackages = { "com.mortals" })
@ServletComponentScan("com.mortals") @ServletComponentScan("com.mortals")
//@ImportResource(locations = { "classpath:config/spring-config.xml" }) @ImportResource(locations = { "classpath:config/spring-config.xml" })
public class GateApiApplication extends BaseWebApplication{ public class GateApiApplication extends BaseWebApplication{
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -5,6 +5,9 @@ import org.springframework.context.annotation.Bean; ...@@ -5,6 +5,9 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.server.SecurityWebFilterChain;
/** /**
* 网关限流配置 * 网关限流配置
...@@ -13,10 +16,20 @@ import org.springframework.core.annotation.Order; ...@@ -13,10 +16,20 @@ import org.springframework.core.annotation.Order;
* @date: 2022/6/20 13:52 * @date: 2022/6/20 13:52
*/ */
@Configuration @Configuration
@EnableWebFluxSecurity
public class GatewayConfig { public class GatewayConfig {
@Bean @Bean
@Order(Ordered.HIGHEST_PRECEDENCE) @Order(Ordered.HIGHEST_PRECEDENCE)
public SentinelFallbackHandler sentinelGatewayExceptionHandler() { public SentinelFallbackHandler sentinelGatewayExceptionHandler() {
return new SentinelFallbackHandler(); return new SentinelFallbackHandler();
} }
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
//配置白名单和访问规则,CommonEnum枚举类
http.csrf().disable();
return http.build();
}
} }
\ No newline at end of file
...@@ -35,7 +35,7 @@ public class AuthFilter { ...@@ -35,7 +35,7 @@ public class AuthFilter {
.notMatch(ignoreWhite.getWhites()) .notMatch(ignoreWhite.getWhites())
.check(r -> { .check(r -> {
// 检查是否登录 是否有token // 检查是否登录 是否有token
StpUtil.checkLogin(); // StpUtil.checkLogin();
// 有效率影响 用于临时测试 // 有效率影响 用于临时测试
// if (log.isDebugEnabled()) { // if (log.isDebugEnabled()) {
// log.debug("剩余有效时间: {}", StpUtil.getTokenTimeout()); // log.debug("剩余有效时间: {}", StpUtil.getTokenTimeout());
......
...@@ -21,7 +21,7 @@ public class ForwardAuthFilter implements GlobalFilter { ...@@ -21,7 +21,7 @@ public class ForwardAuthFilter implements GlobalFilter {
ServerHttpRequest newRequest = exchange ServerHttpRequest newRequest = exchange
.getRequest() .getRequest()
.mutate() .mutate()
// 为请求添加 Id-Token 参数 // 为所有请求添加 Id-Token 参数,其它系统验证是否有token 如果没有则是非法服务
.header(SaIdUtil.ID_TOKEN, SaIdUtil.getToken()) .header(SaIdUtil.ID_TOKEN, SaIdUtil.getToken())
.build(); .build();
ServerWebExchange newExchange = exchange.mutate().request(newRequest).build(); ServerWebExchange newExchange = exchange.mutate().request(newRequest).build();
......
...@@ -31,6 +31,7 @@ public class GlobalCacheRequestFilter implements GlobalFilter, Ordered { ...@@ -31,6 +31,7 @@ public class GlobalCacheRequestFilter implements GlobalFilter, Ordered {
} }
return chain.filter(exchange.mutate().request(serverHttpRequest).build()); return chain.filter(exchange.mutate().request(serverHttpRequest).build());
}); });
} }
@Override @Override
......
...@@ -42,7 +42,41 @@ public class GlobalLogFilter implements GlobalFilter, Ordered { ...@@ -42,7 +42,41 @@ public class GlobalLogFilter implements GlobalFilter, Ordered {
@Override @Override
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
ServerHttpRequest request = exchange.getRequest();
return chain.filter(exchange);
/* if (!customGatewayProperties.getRequestLog()) {
return chain.filter(exchange);
}*/
/* ServerHttpRequest request = exchange.getRequest();
String path = getOriginalRequestUrl(exchange);
String url = request.getMethod().name() + " " + path;
// 打印请求参数
if (isJsonRequest(request)) {
String jsonParam = resolveBodyFromRequest(request);
log.info("开始请求 => URL[{}],参数类型[json],参数:[{}]", url, jsonParam);
} else {
MultiValueMap<String, String> parameterMap = request.getQueryParams();
if (MapUtil.isNotEmpty(parameterMap)) {
log.info("开始请求 => URL[{}],参数类型[param],参数:[{}]", url, JSON.toJSONString(parameterMap));
} else {
log.info("开始请求 => URL[{}],无参数", url);
}
}
exchange.getAttributes().put(START_TIME, System.currentTimeMillis());
return chain.filter(exchange).then(Mono.fromRunnable(() -> {
Long startTime = exchange.getAttribute(START_TIME);
if (startTime != null) {
long executeTime = (System.currentTimeMillis() - startTime);
log.info("结束请求 => URL[{}],耗时:[{}]毫秒", url, executeTime);
}
}));*/
/*ServerHttpRequest request = exchange.getRequest();
String path = getOriginalRequestUrl(exchange); String path = getOriginalRequestUrl(exchange);
String url = request.getMethod().name() + " " + path; String url = request.getMethod().name() + " " + path;
...@@ -69,7 +103,7 @@ public class GlobalLogFilter implements GlobalFilter, Ordered { ...@@ -69,7 +103,7 @@ public class GlobalLogFilter implements GlobalFilter, Ordered {
long executeTime = (System.currentTimeMillis() - startTime); long executeTime = (System.currentTimeMillis() - startTime);
log.debug("结束请求 => URL[{}],耗时:[{}]毫秒", url, executeTime); log.debug("结束请求 => URL[{}],耗时:[{}]毫秒", url, executeTime);
} }
})); }));*/
} }
@Override @Override
......
...@@ -2,6 +2,9 @@ server: ...@@ -2,6 +2,9 @@ server:
tomcat: tomcat:
uri-encoding: utf-8 uri-encoding: utf-8
spring: spring:
main:
web-application-type: reactive
allow-bean-definition-overriding: true
application: application:
name: @project.artifactId@ name: @project.artifactId@
profiles: profiles:
...@@ -11,6 +14,26 @@ spring: ...@@ -11,6 +14,26 @@ spring:
maxFileSize: 100Mb maxFileSize: 100Mb
maxRequestSize: 1000Mb maxRequestSize: 1000Mb
cloud: cloud:
# 网关配置
gateway:
httpclient:
connect-timeout: 1000
response-timeout: 5s
# 打印请求日志(自定义)
requestLog: true
discovery:
locator:
lowerCaseServiceId: true
enabled: true
routes:
# 基础服务
- id: base-manager
# uri: http://127.0.0.1:17211
uri: lb://base-manager
predicates:
- Path=/base/**
# filters:
# - StripPrefix=1
nacos: nacos:
# Nacos 作为注册中心的配置项,对应 NacosDiscoveryProperties 配置类 # Nacos 作为注册中心的配置项,对应 NacosDiscoveryProperties 配置类
discovery: discovery:
...@@ -23,6 +46,42 @@ spring: ...@@ -23,6 +46,42 @@ spring:
namespace: ${spring.cloud.nacos.discovery.namespace} # Nacos 命名空间 dev 的编号 namespace: ${spring.cloud.nacos.discovery.namespace} # Nacos 命名空间 dev 的编号
file-extension: yaml file-extension: yaml
# 安全配置
security:
# 验证码
captcha:
# 是否开启验证码
enabled: true
# 验证码类型 math 数组计算 char 字符验证
type: MATH
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
category: CIRCLE
# 数字验证码位数
numberLength: 1
# 字符验证码长度
charLength: 4
# 防止XSS攻击
xss:
enabled: true
excludeUrls:
- /system/notice
# 不校验白名单
ignore:
whites:
- /code
- /auth/logout
- /base/login/login
- /auth/smsLogin
- /auth/xcxLogin
- /auth/register
- /resource/sms/code
logging:
level:
reactor.netty: DEBUG
org.springframework.cloud.gateway: TRACE
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment