提交修改
This commit is contained in:
parent
b664c0c1a2
commit
92798b99a0
@ -88,10 +88,6 @@ public class LogAop {
|
||||
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
|
||||
|
||||
args = recordRequestLog(point.getArgs(), uri);
|
||||
Signature sig = point.getSignature();
|
||||
Method method = ((MethodSignature) sig).getMethod();
|
||||
@ -110,7 +106,6 @@ public class LogAop {
|
||||
.append("uri:").append(uri);
|
||||
|
||||
|
||||
|
||||
// 默认对有的接口进行拦截
|
||||
Boolean intercept = faceAuthMap.get(className);
|
||||
Boolean classMethodConfigNotIntercept = faceAuthMap.get(classNameAndMethodName);
|
||||
@ -128,9 +123,14 @@ public class LogAop {
|
||||
faceAuthTentMap.put(classNameAndMethodNametencent, tencent);
|
||||
log.info("LogAop one cache className:{},classNameAndMethodName:{},classNameAndMethodNametencent:{}", intercept, classMethodConfigNotIntercept, tencent);
|
||||
}
|
||||
if (classMethodConfigNotIntercept) {
|
||||
return point.proceed();
|
||||
}
|
||||
try {
|
||||
|
||||
|
||||
// 如果方法和类上都没有配置NotIntercept注解 ,则需要拦截 ,是linux才进行拦截
|
||||
if (intercept && classMethodConfigNotIntercept && OsUtil.isLinux()) {
|
||||
if (intercept && OsUtil.isLinux()) {
|
||||
String authConfig = request.getHeader("X-TCloudMarket-Custom-AuthConfig");
|
||||
if (StringUtils.isBlank(authConfig) || !authConfig.startsWith("{")) {
|
||||
log.info("LogAop authConfig value:{} auth error ", authConfig);
|
||||
@ -172,9 +172,6 @@ public class LogAop {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private String recordRequestLog(Object[] argArrs, String uri) {
|
||||
String mediaType = "";
|
||||
String args = null;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.heyu.api.controller.vv;
|
||||
|
||||
|
||||
import com.heyu.api.data.annotation.NotIntercept;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -10,11 +11,13 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@NotIntercept
|
||||
public class AppOssAuthController {
|
||||
|
||||
|
||||
// http://localhost:8888/auth
|
||||
@RequestMapping("/auth")
|
||||
public HttpServletResponse auth(HttpServletRequest request, HttpServletResponse response) {
|
||||
public int auth(HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
String uri = request.getRequestURI();
|
||||
|
||||
@ -22,7 +25,7 @@ public class AppOssAuthController {
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
|
||||
return response;
|
||||
return 200;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user