自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-07-22 2004d06189df4f32825dfc76b3fc4abb978fb3a8
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<>();
@@ -72,6 +74,7 @@
        UserLogin userLogin = new UserLogin();
        userLogin.setUserId(user.getId());
        userLogin.setToken(token);
        userLogin.setCreateTime(new Date());
        userLoginService.insert(userLogin);
        Map<String, Object> res = new HashMap<>();
        res.put("username", user.getUsername());
@@ -79,10 +82,16 @@
        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) throws Exception {
        String code = null;
@@ -138,7 +147,7 @@
                    // 是否拥有查看权限
                    if (getUserId() != 9527) {
                        Resource view = resourceService.selectOne(new EntityWrapper<Resource>().eq("resource_id", resource.getId()).like("code", "view"));
                        Resource view = resourceService.selectOne(new EntityWrapper<Resource>().eq("resource_id", resource.getId()).like("code", "#view"));
                        if (!Cools.isEmpty(view)){
                            RoleResource param = new RoleResource();
                            param.setResourceId(view.getId());
@@ -250,7 +259,7 @@
    }
    @RequestMapping("/power/auth")
    @ManagerAuth
    @ManagerAuth(memo = "授权")
    @Transactional
    public R power(Long roleId, String powers){
        Role role = roleService.selectById(roleId);