| | |
| | | try { |
| | | //Boolean flag = cacheManager.getCacheNames().isEmpty() ; |
| | | uuid = UUID.randomUUID().toString(); |
| | | userPo = this.sv.login(uuid, vo.phone, vo.password); |
| | | userPo = this.sv.loginWithMapperXml(uuid, vo.phone, vo.password); |
| | | } catch (Exception e) { |
| | | log.error("用户登录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | |
| | | try { |
| | | //Boolean flag = cacheManager.getCacheNames().isEmpty() ; |
| | | uuid = UUID.randomUUID().toString(); |
| | | userPo = this.sv.login(uuid, vo.phone, vo.password); |
| | | userPo = this.sv.loginWithMapperXml(uuid, vo.phone, vo.password); |
| | | } catch (Exception e) { |
| | | log.error("用户登录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | |
| | | if(userPo.supperAdmin != null && userPo.supperAdmin == 1){ |
| | | vo.hasPower = true ; |
| | | }else{ |
| | | if(userPo.privileges != null && userPo.privileges.size() > 0){ |
| | | vo.hasPower = this.hasOnePrivilege(privilege, userPo) ; |
| | | if(!vo.hasPower){ |
| | | vo.hasPower = this.hasAllPrivilege(allPrivilege, userPo) ; |
| | | if(privilege.equals("-1")){ |
| | | //无需权限验证 |
| | | vo.hasPower = true ; |
| | | }else{ |
| | | if(userPo.privileges != null && userPo.privileges.size() > 0){ |
| | | vo.hasPower = this.hasOnePrivilege(privilege, userPo) ; |
| | | if(!vo.hasPower){ |
| | | vo.hasPower = this.hasAnyPrivilege(anyPrivilege, userPo) ; |
| | | vo.hasPower = this.hasAllPrivilege(allPrivilege, userPo) ; |
| | | if(!vo.hasPower){ |
| | | vo.hasPower = this.hasAnyPrivilege(anyPrivilege, userPo) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | return vo ; |
| | | } |
| | | |
| | | ///////////////////////////////////////////////////////////////// |
| | | // |
| | | // 以下私有方法 |
| | | // |
| | | ///////////////////////////////////////////////////////////////// |
| | | /** |
| | | * 判断登录用户是否拥有指定的一个权限 |
| | | * @param privilege 指定的一个权限 |