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