update 优化 satoken 使用 loginType 分离登录用户

feature/model
疯狂的狮子Li 1 year ago
parent 8573ffdd7f
commit 7193ee08c9

@ -68,9 +68,10 @@ public class LoginHelper {
// } else if (userType == UserType.APP_USER) { // } else if (userType == UserType.APP_USER) {
// model.setTimeout(86400).setActiveTimeout(1800); // model.setTimeout(86400).setActiveTimeout(1800);
// } // }
StpUtil.login(loginUser.getLoginId(), StpUtil.stpLogic.setLoginType(loginUser.getUserType())
model.setExtra(TENANT_KEY, loginUser.getTenantId()) .login(loginUser.getLoginId(),
.setExtra(USER_KEY, loginUser.getUserId())); model.setExtra(TENANT_KEY, loginUser.getTenantId())
.setExtra(USER_KEY, loginUser.getUserId()));
StpUtil.getTokenSession().set(LOGIN_USER_KEY, loginUser); StpUtil.getTokenSession().set(LOGIN_USER_KEY, loginUser);
} }
@ -154,8 +155,8 @@ public class LoginHelper {
* *
*/ */
public static UserType getUserType() { public static UserType getUserType() {
String loginId = StpUtil.getLoginIdAsString(); String loginType = StpUtil.stpLogic.getLoginType();
return UserType.getUserType(loginId); return UserType.getUserType(loginType);
} }
/** /**

Loading…
Cancel
Save