自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-06-13 63b6ae940687d2de076ff74bff9aaa187d843d5d
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);