分店切换修改
This commit is contained in:
parent
706b8e64d3
commit
f98ffcae1a
|
|
@ -73,21 +73,21 @@ public class MyStpLogic {
|
|||
public void switchTo(boolean isMain, Long id, String account, Long shopId, String shopName, LoginType loginType, boolean isAdmin) {
|
||||
StpLogic logic = getLogic();
|
||||
long headId = logic.getLoginIdAsLong();
|
||||
|
||||
logic.getSaTokenDao().set(splicingKeyTokenValue(logic.getTokenValue()), id.toString(), logic.getTokenTimeout());
|
||||
// 设置主店id
|
||||
Object mainShopId = logic.getSession().get("mainShopId");
|
||||
SaSession session = logic.getSession();
|
||||
Object parentId1 = session.get("headShopId");
|
||||
logic.getSaTokenDao().set(splicingKeyTokenValue(logic.getTokenValue()), id.toString(), logic.getTokenTimeout());
|
||||
session = logic.getSession();
|
||||
if (session == null) {
|
||||
logic.createLoginSession(id);
|
||||
session = logic.getSession();
|
||||
}
|
||||
// 主店没有headShopId
|
||||
Object parentId1 = session.get("headShopId");
|
||||
if (!isMain && parentId1 == null) {
|
||||
session.set("headId", headId);
|
||||
}
|
||||
|
||||
// 设置主店id
|
||||
Object mainShopId = session.get("mainShopId");
|
||||
session.set("userId", id).set("isAdmin", isAdmin).set("isManager", loginType.equals(LoginType.MANAGER))
|
||||
.set("loginType", loginType).set("account", account).set("shopId", shopId).set("shopName", shopName)
|
||||
.set("mainShopId", mainShopId);
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
|||
}
|
||||
|
||||
redisService.del(RedisCst.LOGIN_CODE + loginDTO.uuid());
|
||||
System.out.println(StpKit.USER.getMainShopId());
|
||||
return new LoginVO(StpKit.USER.getTokenInfo(), promissionList, loginDTO.loginType(), shopInfo, shopStaff);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue