Browse Source

清楚账户缓存

guq 7 years ago
parent
commit
5f4d47f83d

+ 10 - 4
applications/operation/operation-auth-server/src/main/java/com/usoftchina/saas/operation/auth/controller/AuthController.java

@@ -18,12 +18,10 @@ import com.usoftchina.saas.operation.auth.service.AuthorizeLogService;
 import com.usoftchina.saas.utils.BeanMapper;
 import com.usoftchina.saas.utils.CollectionUtils;
 import com.usoftchina.saas.utils.RedisUtil;
+import com.usoftchina.saas.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Optional;
@@ -100,5 +98,13 @@ public class AuthController {
         return Result.error(result.getCode(), result.getMessage());
     }
 
+    @GetMapping("/clearAuthorizeCount")
+    public Result clearAuthorizeCount(@RequestParam String username) {
+        if (StringUtils.isEmpty(username)) {
+            return Result.error("请输入用户名");
+        }
+        authorizeCountService.clear(username);
+        return Result.success();
+    }
 
 }