parent
b9f535977c
commit
2af1db738b
|
|
@ -1,5 +1,6 @@
|
|||
package com.czg.service.account.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
|
@ -154,6 +155,15 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
|||
if (user.getIsAdmin()) {
|
||||
roleNames.add("admin");
|
||||
}
|
||||
Long headShopId = StpKit.USER.getHeadShopId(shopInfo.getId());
|
||||
if (headShopId.equals(shopInfo.getId())) {
|
||||
} else {
|
||||
boolean isEnableSync = StpKit.USER.isEnableSync(headShopId);
|
||||
if (isEnableSync && CollUtil.contains(roleNames, "商户")) {
|
||||
roleNames.remove("商户");
|
||||
roleNames.remove("分店商户");
|
||||
}
|
||||
}
|
||||
StpKit.USER.addRoleList(roleNames);
|
||||
// 权限赋予
|
||||
List<String> promissionList = sysMenuMapper.selectByUserId(user.getId(), null).stream().map(SysMenu::getPermission).filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
|
|
@ -210,6 +220,15 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
|||
if (sysUser.getIsAdmin()) {
|
||||
roleNames.add("admin");
|
||||
}
|
||||
Long headShopId = StpKit.USER.getHeadShopId(shopInfo.getId());
|
||||
if (headShopId.equals(shopInfo.getId())) {
|
||||
} else {
|
||||
boolean isEnableSync = StpKit.USER.isEnableSync(headShopId);
|
||||
if (isEnableSync && CollUtil.contains(roleNames, "商户")) {
|
||||
roleNames.remove("商户");
|
||||
roleNames.remove("分店商户");
|
||||
}
|
||||
}
|
||||
StpKit.USER.addRoleList(roleNames);
|
||||
// 权限赋予
|
||||
List<String> promissionList = sysMenuMapper.selectByUserId(sysUser.getId(), null).stream().map(SysMenu::getPermission).filter(StrUtil::isNotBlank).toList();
|
||||
|
|
|
|||
Loading…
Reference in New Issue