Explorar el Código

添加几个LogAnnotation 避免无用日志

NorthLan hace 6 años
padre
commit
81bf30de2f

+ 4 - 0
zen-web/src/main/kotlin/com/gxzc/zen/web/sys/controller/AuthController.kt

@@ -3,6 +3,7 @@ package com.gxzc.zen.web.sys.controller
 import com.gxzc.zen.common.base.BaseController
 import com.gxzc.zen.common.dto.RequestDto
 import com.gxzc.zen.common.dto.ResponseDto
+import com.gxzc.zen.logging.annotation.LogAnnotation
 import io.swagger.annotations.ApiOperation
 import org.apache.shiro.SecurityUtils
 import org.slf4j.LoggerFactory
@@ -25,6 +26,7 @@ class AuthController : BaseController() {
 
     @ApiOperation("设置cookie")
     @PostMapping("/setcookie")
+    @LogAnnotation(ignore = true)
     fun token(@RequestBody cookies: List<RequestDto>): ResponseEntity<*> {
         cookies.forEach {
             getResponse().addCookie(Cookie(it["name"]?.toString(), it["value"]?.toString()).apply {
@@ -38,6 +40,7 @@ class AuthController : BaseController() {
 
     @ApiOperation(value = "登出")
     @DeleteMapping("/logout")
+    @LogAnnotation(ignore = true)
     fun logout(): ResponseEntity<*> {
         SecurityUtils.getSubject().logout()
 //        SSOHelper.clearLogin(getRequest(), getResponse())
@@ -46,6 +49,7 @@ class AuthController : BaseController() {
 
     @ApiOperation(value = "验证登录状态")
     @GetMapping("/check")
+    @LogAnnotation(ignore = true)
     fun check(): ResponseEntity<*> {
         val subject = SecurityUtils.getSubject()
         return if (subject != null && subject.isAuthenticated) {