|
|
@@ -2,12 +2,14 @@ package com.fs.framework.aspectj;
|
|
|
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.fs.hospital580.config.Hospital580Config;
|
|
|
import com.fs.hospital580.util.ObjectApiSignUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.aspectj.lang.JoinPoint;
|
|
|
import org.aspectj.lang.annotation.Aspect;
|
|
|
import org.aspectj.lang.annotation.Before;
|
|
|
import org.aspectj.lang.annotation.Pointcut;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -17,8 +19,8 @@ import org.springframework.stereotype.Component;
|
|
|
public class Hospital580Aspect {
|
|
|
|
|
|
|
|
|
- @Value("${hospital580.secretKey:''}")
|
|
|
- private String SECRETKEY;
|
|
|
+ @Autowired
|
|
|
+ private Hospital580Config hospital580Config;
|
|
|
|
|
|
|
|
|
@Pointcut("execution(* com.fs.app.controller.Hospital580CallbackController.*(..))")
|
|
|
@@ -35,13 +37,13 @@ public class Hospital580Aspect {
|
|
|
String methodName = joinPoint.getSignature().getName();
|
|
|
Object[] args = joinPoint.getArgs();
|
|
|
Object parm = args[0];
|
|
|
- log.info("580医院请求:{} {}", methodName,JSONUtil.toJsonStr(parm));
|
|
|
JSONObject entries = JSONUtil.parseObj(parm);
|
|
|
+ log.info("580医院请求:{} {}", methodName,entries);
|
|
|
String sign1 = entries.getStr("sign");
|
|
|
- String sign = ObjectApiSignUtil.getSign(parm, SECRETKEY);
|
|
|
-/* if (!sign1.equals(sign)) {
|
|
|
+ String sign = ObjectApiSignUtil.getSign(parm, hospital580Config.getSecretKey());
|
|
|
+ if (!sign1.equals(sign)) {
|
|
|
log.info("验签失败");
|
|
|
throw new RuntimeException("验签失败");
|
|
|
- }*/
|
|
|
+ }
|
|
|
}
|
|
|
}
|