升级支持SpringCloud 2021,Knife4j版本升级
This commit is contained in:
@@ -2,6 +2,8 @@ package com.macro.mall.auth.config;
|
||||
|
||||
import com.macro.mall.common.config.BaseSwaggerConfig;
|
||||
import com.macro.mall.common.domain.SwaggerProperties;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@@ -24,4 +26,9 @@ public class SwaggerConfig extends BaseSwaggerConfig {
|
||||
.enableSecurity(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() {
|
||||
return generateBeanPostProcessor();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.requestMatchers(EndpointRequest.toAnyEndpoint()).permitAll()
|
||||
.antMatchers("/rsa/publicKey").permitAll()
|
||||
.antMatchers("/v2/api-docs").permitAll()
|
||||
.antMatchers("/oauth/token").permitAll()
|
||||
.anyRequest().authenticated();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.macro.mall.auth.controller;
|
||||
|
||||
import com.nimbusds.jose.jwk.JWKSet;
|
||||
import com.nimbusds.jose.jwk.RSAKey;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.security.KeyPair;
|
||||
@@ -15,12 +17,14 @@ import java.util.Map;
|
||||
* Created by macro on 2020/6/19.
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "KeyPairController", description = "获取RSA公钥接口")
|
||||
@RequestMapping("/rsa")
|
||||
public class KeyPairController {
|
||||
|
||||
@Autowired
|
||||
private KeyPair keyPair;
|
||||
|
||||
@GetMapping("/rsa/publicKey")
|
||||
@GetMapping("/publicKey")
|
||||
public Map<String, Object> getKey() {
|
||||
RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
|
||||
RSAKey key = new RSAKey.Builder(publicKey).build();
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
|
||||
server:
|
||||
port: 8401
|
||||
spring:
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
@@ -8,6 +13,9 @@ management:
|
||||
feign:
|
||||
okhttp:
|
||||
enabled: true
|
||||
ribbon:
|
||||
ConnectTimeout: 3000 #服务请求连接超时时间(毫秒)
|
||||
ReadTimeout: 3000 #服务请求处理超时时间(毫秒)
|
||||
client:
|
||||
config:
|
||||
default:
|
||||
connectTimeout: 5000
|
||||
readTimeout: 5000
|
||||
loggerLevel: basic
|
||||
|
||||
Reference in New Issue
Block a user