From 01b8c23ee38fad048f7bb10de95769bbf77c9db7 Mon Sep 17 00:00:00 2001 From: qi Date: Fri, 17 Apr 2020 17:36:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cms/service/impl/SysResourceServiceImpl.java | 5 ++--- .../SysRoleResourcePermissionServiceImpl.java | 16 ++++++++-------- .../java/com/lq/cms/web/BaseAdminController.java | 10 +++++----- .../java/com/lq/cms/web/LoginController.java | 1 - 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/lq/cms/service/impl/SysResourceServiceImpl.java b/src/main/java/com/lq/cms/service/impl/SysResourceServiceImpl.java index b5b238c..260b67f 100755 --- a/src/main/java/com/lq/cms/service/impl/SysResourceServiceImpl.java +++ b/src/main/java/com/lq/cms/service/impl/SysResourceServiceImpl.java @@ -1,6 +1,6 @@ package com.lq.cms.service.impl; -import com.lq.cms.emun.PermissionTyepEnum; +import com.lq.cms.emun.PermissionTypeEnum; import com.lq.cms.emun.StatusTypeEnum; import com.lq.cms.mode.Menus; import com.lq.cms.mode.MenusComposite; @@ -15,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.*; -import java.util.stream.Collectors; /** * Created by qi_liang on 2018/6/21. @@ -55,7 +54,7 @@ public class SysResourceServiceImpl implements SysResourceService { Map map=new HashMap(3); map.put("userId",sysUserId); map.put("parentId", Constant.TOP_PARENT_ID); - map.put("permissionId", PermissionTyepEnum.SELECT.getValue()); + map.put("permissionId", PermissionTypeEnum.SELECT.getValue()); List menusItmeList=sysResourceDao.findMenu(map); List list=new ArrayList<>(); menusItmeList.forEach(sysResource->{ diff --git a/src/main/java/com/lq/cms/service/impl/SysRoleResourcePermissionServiceImpl.java b/src/main/java/com/lq/cms/service/impl/SysRoleResourcePermissionServiceImpl.java index 470cb8e..001b7bc 100755 --- a/src/main/java/com/lq/cms/service/impl/SysRoleResourcePermissionServiceImpl.java +++ b/src/main/java/com/lq/cms/service/impl/SysRoleResourcePermissionServiceImpl.java @@ -1,7 +1,7 @@ package com.lq.cms.service.impl; import com.lq.cms.emun.BasicsPermissionKeyEnum; -import com.lq.cms.emun.PermissionTyepEnum; +import com.lq.cms.emun.PermissionTypeEnum; import com.lq.cms.emun.StatusTypeEnum; import com.lq.cms.mode.Ztree; import com.lq.cms.mode.ZtreeComposite; @@ -56,17 +56,17 @@ public class SysRoleResourcePermissionServiceImpl implements SysRoleResourcePer ztreeItem.setId(sysResource.getId()); ztreeItem.setIconCls(sysResource.getMenuIco()); ztreeItem.setText(sysResource.getMenuName()); - ztreeItem.setChecked(isCheck(sysResource.getId(), PermissionTyepEnum.SELECT.getValue(),roleId)); + ztreeItem.setChecked(isCheck(sysResource.getId(), PermissionTypeEnum.SELECT.getValue(),roleId)); ztreeItem.setState("close"); - ztreeItem.setAttributes(getAttributes(sysResource.getId(), Long.valueOf(PermissionTyepEnum.SELECT.getValue()))); + ztreeItem.setAttributes(getAttributes(sysResource.getId(), Long.valueOf(PermissionTypeEnum.SELECT.getValue()))); List menuItmeList=sysResourceDao.findByParentId(sysResource.getId()); for (SysResource resource:menuItmeList){ ZtreeItem ztreeItme1=new ZtreeItem(); ztreeItme1.setId(resource.getId()); ztreeItme1.setText(resource.getMenuName()); ztreeItme1.setIconCls(resource.getMenuIco()); - ztreeItme1.setChecked(isCheck(resource.getId(), PermissionTyepEnum.SELECT.getValue(),roleId)); - ztreeItme1.setAttributes(getAttributes(resource.getId(),PermissionTyepEnum.SELECT.getValue())); + ztreeItme1.setChecked(isCheck(resource.getId(), PermissionTypeEnum.SELECT.getValue(),roleId)); + ztreeItme1.setAttributes(getAttributes(resource.getId(), PermissionTypeEnum.SELECT.getValue())); List permissionList = sysPermissionDao.findBySysResourceId(resource.getId()); for (SysPermission sysPermission:permissionList){ if (BasicsPermissionKeyEnum.SELECT_MENU_KEY.getValue().equals(sysPermission.getPermissionKey())){ @@ -127,16 +127,16 @@ public class SysRoleResourcePermissionServiceImpl implements SysRoleResourcePer List list = new ArrayList<>(); List sysResourceList = sysResourceDao.findAll(); Iterator iterator = sysResourceList.iterator(); - PermissionTyepEnum[] tyepEnums = PermissionTyepEnum.values(); + PermissionTypeEnum[] tyepEnums = PermissionTypeEnum.values(); while (iterator.hasNext()){ SysResource sysResource = iterator.next(); if (sysResource!=null){ - for (PermissionTyepEnum permissionTyepEnum:tyepEnums){ + for (PermissionTypeEnum permissionTypeEnum :tyepEnums){ PermissionVo permissionVo = new PermissionVo(); permissionVo.setMenuId(sysResource.getId()); permissionVo.setMenuName(sysResource.getMenuName()); permissionVo.setMenuUrl(sysResource.getUrlPath()); - permissionVo.setPermissionName(permissionTyepEnum.getConstant()); + permissionVo.setPermissionName(permissionTypeEnum.getConstant()); list.add(permissionVo); } } diff --git a/src/main/java/com/lq/cms/web/BaseAdminController.java b/src/main/java/com/lq/cms/web/BaseAdminController.java index fa47ff8..51b478e 100755 --- a/src/main/java/com/lq/cms/web/BaseAdminController.java +++ b/src/main/java/com/lq/cms/web/BaseAdminController.java @@ -1,6 +1,6 @@ package com.lq.cms.web; -import com.lq.cms.emun.PermissionTyepEnum; +import com.lq.cms.emun.PermissionTypeEnum; import com.lq.cms.mode.AdminDataGridParam; import com.lq.cms.service.AdminBaseService; import com.lq.cms.vo.AdminBaseVo; @@ -48,7 +48,7 @@ public abstract class BaseAdminController { @ResponseBody public AdminDataGridParam list(V vo){ Subject subject = SecurityUtils.getSubject(); - subject.checkPermission(getIndexUrl()+ Constant.PERSSION_MARK+ PermissionTyepEnum.SELECT.getConstant()); + subject.checkPermission(getIndexUrl()+ Constant.PERSSION_MARK+ PermissionTypeEnum.SELECT.getConstant()); AdminDataGridParam adminDataGridParam = setPageDate(vo); return adminDataGridParam; } @@ -57,7 +57,7 @@ public abstract class BaseAdminController { @ResponseBody public AjaxResult save(V vo) throws InstantiationException, IllegalAccessException { Subject subject = SecurityUtils.getSubject(); - subject.checkPermission(getIndexUrl()+Constant.PERSSION_MARK+ PermissionTyepEnum.INSERT.getConstant()); + subject.checkPermission(getIndexUrl()+Constant.PERSSION_MARK+ PermissionTypeEnum.INSERT.getConstant()); AjaxResult ajaxResult = new AjaxResult(); T t = getBaseService().save(vo); ajaxResult.setData(t); @@ -68,7 +68,7 @@ public abstract class BaseAdminController { @ResponseBody public AjaxResult update(V vo){ Subject subject = SecurityUtils.getSubject(); - subject.checkPermission(getIndexUrl()+Constant.PERSSION_MARK+ PermissionTyepEnum.UPDATE.getConstant()); + subject.checkPermission(getIndexUrl()+Constant.PERSSION_MARK+ PermissionTypeEnum.UPDATE.getConstant()); AjaxResult ajaxResult= new AjaxResult(); getBaseService().update(vo); return ajaxResult; @@ -78,7 +78,7 @@ public abstract class BaseAdminController { @ResponseBody public AjaxResult delete(Long id){ Subject subject = SecurityUtils.getSubject(); - subject.checkPermission(getIndexUrl()+Constant.PERSSION_MARK+ PermissionTyepEnum.DELETE.getConstant()); + subject.checkPermission(getIndexUrl()+Constant.PERSSION_MARK+ PermissionTypeEnum.DELETE.getConstant()); AjaxResult ajaxResult = new AjaxResult(); getBaseService().delete(id); return ajaxResult; diff --git a/src/main/java/com/lq/cms/web/LoginController.java b/src/main/java/com/lq/cms/web/LoginController.java index 2c31138..208dff7 100755 --- a/src/main/java/com/lq/cms/web/LoginController.java +++ b/src/main/java/com/lq/cms/web/LoginController.java @@ -69,7 +69,6 @@ public class LoginController extends BaseController{ Subject subject=SecurityUtils.getSubject(); UsernamePasswordToken token=new UsernamePasswordToken(loginName,password.toCharArray()); -// UsernamePasswordToken token=new UsernamePasswordToken(loginName,password,false); try { subject.login(token); }catch (UnknownAccountException e){