Merge branch 'prod' into test
This commit is contained in:
@@ -35,7 +35,6 @@ public class MyStpLogic {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public enum LoginType {
|
||||
MANAGER, USER, STAFF
|
||||
}
|
||||
@@ -71,26 +70,29 @@ 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();
|
||||
// 设置主店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
|
||||
if (!isMain && parentId1 == null) {
|
||||
session.set("headId", headId);
|
||||
}
|
||||
|
||||
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("isMainShop", isMain)
|
||||
.set("mainShopId", mainShopId);
|
||||
session.set("shopId", shopId).set("shopName", shopName);
|
||||
|
||||
// long headId = logic.getLoginIdAsLong();
|
||||
// // 设置主店id
|
||||
// Object mainShopId = logic.getSession().get("mainShopId");
|
||||
//
|
||||
// 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
|
||||
// if (!isMain && parentId1 == null) {
|
||||
// session.set("headId", headId);
|
||||
// }
|
||||
//
|
||||
// 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("isMainShop", isMain)
|
||||
// .set("mainShopId", mainShopId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -76,10 +76,6 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
||||
return Map.of("code", captcha.toBase64(), "uuid", captchaKey);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(DateUtil.format(DateUtil.date(), "HHmm"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoginVO login(SysLoginDTO loginDTO, String platType) {
|
||||
Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid());
|
||||
@@ -224,7 +220,7 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
||||
}
|
||||
|
||||
// 主店铺切换子店铺
|
||||
if (headId != null && !shopInfo.getMainId().equals(shopId)) {
|
||||
if (shopInfo.getMainId() != null && !shopInfo.getMainId().equals(shopId)) {
|
||||
throw new CzgException("目标店铺非登录账号所有");
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Main {
|
||||
//是否生成DTO实体 默认生成
|
||||
boolean isGenerateDto = true;
|
||||
|
||||
initTableEntity(packageName, tableName, author, isGenerateDto);
|
||||
// initTableEntity(packageName, tableName, author, isGenerateDto);
|
||||
}
|
||||
|
||||
public static void initTableEntity(String packageName, String tableName, String author, boolean isGenerateDto) {
|
||||
|
||||
Reference in New Issue
Block a user