From 08dedb37c27f31a2251bbcff63036d990c5e1180 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 15 六月 2020 13:22:40 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/web/AuthController.java | 25 +++++++++++++++++++++----
1 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/zy/common/web/AuthController.java b/src/main/java/com/zy/common/web/AuthController.java
index dc4dca3..835ba54 100644
--- a/src/main/java/com/zy/common/web/AuthController.java
+++ b/src/main/java/com/zy/common/web/AuthController.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.zy.common.CodeRes;
+import com.zy.common.entity.Parameter;
import com.zy.common.model.PowerDto;
import com.zy.common.model.enums.HtmlNavIconType;
import com.zy.common.utils.RandomValidateCodeUtil;
@@ -48,6 +49,7 @@
private RolePermissionService rolePermissionService;
@RequestMapping("/login.action")
+ @ManagerAuth(value = ManagerAuth.Auth.NONE, memo = "鐧诲綍")
public R loginAction(String mobile, String password){
if (mobile.equals("super") && password.equals(Cools.md5(superPwd))) {
Map<String, Object> res = new HashMap<>();
@@ -79,14 +81,29 @@
return R.ok(res);
}
+ @RequestMapping("/code/switch.action")
+ public R code() {
+ return R.ok().add(Parameter.get().getCodeSwitch());
+ }
+
@RequestMapping("/code.action")
public void code(@RequestParam String sd, HttpServletResponse response) {
RandomValidateCodeUtil.getRandcode(sd, response);
}
@RequestMapping("/code.do")
- public String codeDo(@RequestParam String sd) {
- String code = RandomValidateCodeUtil.code.get(sd);
+ public String codeDo(@RequestParam String sd) throws Exception {
+ String code = null;
+ int time = 0;
+ while (time < 3000) {
+ code = RandomValidateCodeUtil.code.get(sd);
+ if (!Cools.isEmpty(code)){
+ break;
+ } else {
+ Thread.sleep(10);
+ time = time + 100;
+ }
+ }
RandomValidateCodeUtil.code.remove(sd);
return code;
}
@@ -98,7 +115,7 @@
}
@RequestMapping("/menu/auth")
- @ManagerAuth
+ @ManagerAuth(memo = "棣栭〉鑿滃崟")
public R menu(){
// 鑾峰彇鎵�鏈変竴绾ц彍鍗�
List<Resource> oneLevel = resourceService.selectList(new EntityWrapper<Resource>().eq("level", 1).eq("status", 1).orderBy("sort"));
@@ -241,7 +258,7 @@
}
@RequestMapping("/power/auth")
- @ManagerAuth
+ @ManagerAuth(memo = "鎺堟潈")
@Transactional
public R power(Long roleId, String powers){
Role role = roleService.selectById(roleId);
--
Gitblit v1.9.1