账号切换实现

This commit is contained in:
张松
2025-04-08 18:04:20 +08:00
parent 3e874211d7
commit b8db432134
2 changed files with 10 additions and 3 deletions

View File

@@ -193,7 +193,10 @@ public class AuthorizationServiceImpl implements AuthorizationService {
throw new ApiNotPrintException("店铺信息不存在");
}
if ((headId != null && !shopInfo.getMainId().equals(headId)) || !shopInfo.getMainId().equals(shopId)) {
// 主店铺切换子店铺
if ((headId == null && !shopInfo.getMainId().equals(shopId)) || (!sysUser.getId().equals(headId) && shopInfo.getMainId() == null) ||
(headId != null && !sysUserId.equals(headId) && !shopInfo.getMainId().equals(headId))) {
throw new ApiNotPrintException("目标店铺非登录账号所有");
}