import org.springframework.beans.factory.annotation.Value
import org.springframework.http.ResponseEntity
import org.springframework.security.core.Authentication
+import org.springframework.security.core.context.SecurityContextHolder
import org.springframework.stereotype.Component
import org.springframework.web.bind.annotation.ExceptionHandler
import org.springframework.web.bind.annotation.RestControllerAdvice
fun postmapping() {
}
- @Around("restcontroller() && postmapping() && args(@RequestBody body, auth, ..)")
+ @Around("restcontroller() && postmapping() && args(@RequestBody body, ..)")
@Throws(Throwable::class)
- fun logPostMethods(joinPoint: ProceedingJoinPoint, body: Any, auth: Authentication): Any {
+ fun logPostMethods(joinPoint: ProceedingJoinPoint, body: Any): Any {
return try {
if (body is APIRequestParam) {
body.checkParam()
- if (requestSignCheck && !body.checkSign(commonService.getSecretByAppid(auth.name))) {
+
+ if (requestSignCheck &&
+ !body.checkSign(commonService.getSecretByAppid(
+ SecurityContextHolder.getContext().authentication.name))) {
throw RequestParamCheckException(TradeErrorCode.REQUEST_SIGN_ERROR, "参数签名错误")
}
} else {