切换店铺统计 √

下单选择会员 √
注册会员 √
完善手机号 √
会员流水信息同步 √
This commit is contained in:
Tankaikai
2025-04-11 11:04:59 +08:00
parent 59e5f0b9ea
commit efb833e8f0
2 changed files with 18 additions and 1 deletions

View File

@@ -229,6 +229,19 @@ public class MyStpLogic {
return shopId;
}
/**
* 获取主店id
* @param shopId 店铺id
* @return 主店id
*/
public Long getHeadShopId(Long shopId) {
Long mainId = DbChain.table("tb_shop_config").select("main_id").where("id = ?", shopId).objAs(Long.class);
if (mainId != null) {
return mainId;
}
return shopId;
}
/**
* 校验是否为管理端登录
*/

View File

@@ -197,7 +197,11 @@ public class AuthorizationServiceImpl implements AuthorizationService {
// 主店铺切换子店铺
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("目标店铺非登录账号所有");
Long headShopId = StpKit.USER.getHeadShopId();
Long changeHeadShopId = StpKit.USER.getHeadShopId(sysUserId);
if (!changeHeadShopId.equals(headShopId)) {
throw new ApiNotPrintException("目标店铺非登录账号所有");
}
}
// 查询角色