SUPER_ADMIN_ROLE_KEY

This commit is contained in:
sxu 2025-03-18 11:34:00 +08:00
parent 7313121b92
commit a9027f2973
3 changed files with 10 additions and 1 deletions

View File

@ -5,6 +5,10 @@ package com.bonus.common.houqin.constant;
* @author bns_han
*/
public class GlobalConstants {
/**
* super admin role key
*/
public static final String SUPER_ADMIN_ROLE_KEY = "admin";
/**
* 字符串 MSIE
*/

View File

@ -31,6 +31,7 @@ import com.bonus.canteen.core.common.utils.TreeNodeUtil;
import com.bonus.canteen.core.order.mq.MqUtil;
import com.bonus.canteen.core.order.utils.LeNumUtil;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.houqin.constant.GlobalConstants;
import com.bonus.common.houqin.constant.LeConstants;
import com.bonus.common.houqin.i18n.I18n;
import com.bonus.common.houqin.utils.LeBeanUtil;
@ -202,6 +203,9 @@ public class AllocAreaServiceImpl extends ServiceImpl<AllocAreaMapper, AllocArea
public List<Tree<Long>> getSystemAuthAreaTree() {
MgrUserAuthPO mgrUserAuthPO = this.mgrAuthApi.getUserAuthPO();
List<AllocAreaTreeVO> areaList = ((AllocAreaMapper)this.baseMapper).listSystemArea(TenantContextHolder.getTenantId());
if (GlobalConstants.SUPER_ADMIN_ROLE_KEY.equals(mgrUserAuthPO.getRoleCode())) {
areaList = new ArrayList<>();
}
List<AllocAreaTreeVO> filterAreaTreeList = ((AllocAreaMapper)this.baseMapper).listAllTreeArea();
if (CollUtil.isNotEmpty(filterAreaTreeList)) {
List<Long> filterAreaIdList = (List)filterAreaTreeList.stream().map(BaseTreeNode::getId).collect(Collectors.toList());

View File

@ -24,6 +24,7 @@ import com.bonus.canteen.core.merchant.api.MercMerchantApi;
import com.bonus.canteen.core.merchant.entity.MercMerchant;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.houqin.constant.DelFlagEnum;
import com.bonus.common.houqin.constant.GlobalConstants;
import com.bonus.common.houqin.constant.LeConstants;
import com.bonus.common.houqin.i18n.I18n;
import com.bonus.common.security.utils.SecurityUtils;
@ -89,7 +90,7 @@ public class MgrAuthApi {
String roleCodeResult = null;
for (String roleCode : roleSet) {
roleCodeResult = roleCode;
if (roleCode.startsWith(RoleCodeV2Enum.ROLE_ADMIN.key()) || "admin".equals(roleCode)) {
if (roleCode.startsWith(RoleCodeV2Enum.ROLE_ADMIN.key()) || GlobalConstants.SUPER_ADMIN_ROLE_KEY.equals(roleCode)) {
roleType = MgrRoleTypeV2Enum.ROLE_ADMIN.getKey();
// if (CharSequenceUtil.split(roleCode, "&&").size() > 1) {
// roleType = MgrRoleTypeV2Enum.ROLE_ADMIN.getKey();