fix:添加请求参数校验
This commit is contained in:
parent
e7e8b6a9fd
commit
7232cc5120
@ -0,0 +1,18 @@
|
|||||||
|
package cn.axzo.oss.client.config;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: oss
|
||||||
|
* @description: 访问校验
|
||||||
|
* @author: mr.jie
|
||||||
|
* @date: 2021-07-28 00:50
|
||||||
|
**/
|
||||||
|
@Target({ElementType.METHOD})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface ApiAccessCheck {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package cn.axzo.oss.client.config.resolver;
|
||||||
|
|
||||||
|
import cn.axzo.oss.client.config.ApiAccessCheck;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
|
import org.aspectj.lang.annotation.Around;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: oss
|
||||||
|
* @description: 访问校验实现
|
||||||
|
* @author: mr.jie
|
||||||
|
* @date: 2021-07-28 01:23
|
||||||
|
**/
|
||||||
|
@Aspect
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class ApiAccessCheckResolver {
|
||||||
|
|
||||||
|
|
||||||
|
@Around("@annotation(apiAccessCheck)")
|
||||||
|
public Object methodHandler(ProceedingJoinPoint jp, ApiAccessCheck apiAccessCheck)
|
||||||
|
throws Throwable {
|
||||||
|
Object result = jp.proceed();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -6,10 +6,10 @@ spring:
|
|||||||
config:
|
config:
|
||||||
server-addr: ${NACOS_HOST:dev-nacos.axzo.cn}:${NACOS_PORT:80}
|
server-addr: ${NACOS_HOST:dev-nacos.axzo.cn}:${NACOS_PORT:80}
|
||||||
file-extension: yaml
|
file-extension: yaml
|
||||||
namespace: ${NACOS_NAMESPACE_ID:35eada10-9574-4db8-9fea-bc6a4960b6c7}
|
namespace: ${NACOS_NAMESPACE_ID:f82179f1-81a9-41a1-a489-4f9ab5660a6e}
|
||||||
prefix: ${spring.application.name}
|
prefix: ${spring.application.name}
|
||||||
profiles:
|
profiles:
|
||||||
active: ${NACOS_PROFILES_ACTIVE:dev}
|
active: ${NACOS_PROFILES_ACTIVE:local}
|
||||||
main:
|
main:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user