|
|
@@ -27,6 +27,7 @@ import com.zhongshu.card.server.core.service.base.RedisService;
|
|
|
import com.zhongshu.card.server.core.service.setting.PlatFormConfigInfoService;
|
|
|
import com.zhongshu.card.server.core.service.user.RoleServiceImpl;
|
|
|
import com.zhongshu.card.server.core.service.user.UserAccountServiceImpl;
|
|
|
+import com.zhongshu.card.server.core.util.AesUtils;
|
|
|
import com.zhongshu.card.server.core.util.CommonUtil;
|
|
|
import com.zhongshu.card.server.core.util.wx.WechatCUtil;
|
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
|
@@ -243,7 +244,16 @@ public class IndexService {
|
|
|
stopWatch.start("3");
|
|
|
// 用户所有的权限
|
|
|
Set<String> auth = roleServiceImpl.getUserAllAuths(userAccount.getUserId());
|
|
|
+ String aesStr = "";
|
|
|
+ if (auth != null && !auth.isEmpty()) {
|
|
|
+ try {
|
|
|
+ aesStr = AesUtils.encrypt(String.join(",", auth), "lIllIIIllIIIllIl");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
commonModel.setAuths(auth);
|
|
|
+ commonModel.setPermiss(aesStr);
|
|
|
stopWatch.stop();
|
|
|
log.info(stopWatch.prettyPrint());
|
|
|
|
|
|
@@ -316,8 +326,7 @@ public class IndexService {
|
|
|
if (ObjectUtils.isEmpty(organization)) {
|
|
|
return ResultContent.buildFail(String.format("平台未初始化,请联系管理员"));
|
|
|
}
|
|
|
- if (organization.getState() == OrganizationState.Locked ||
|
|
|
- organization.getState() == OrganizationState.Frozen) {
|
|
|
+ if (organization.getState() == OrganizationState.Locked || organization.getState() == OrganizationState.Frozen) {
|
|
|
return ResultContent.buildFail(String.format("平台已被锁定,不能登录"));
|
|
|
}
|
|
|
UserAccount userAccount = userCountDao.findTopByLoginName(phone);
|
|
|
@@ -475,8 +484,7 @@ public class IndexService {
|
|
|
return ResultContent.buildSuccess(resultContent.getContent());
|
|
|
} else {
|
|
|
// 记录登录失败信息
|
|
|
- userLoginFailRecordDao.save(UserLoginFailRecord.builder().userName(phone)
|
|
|
- .ttl(new Date(dbHelper.getTime() + lockTime)).build());
|
|
|
+ userLoginFailRecordDao.save(UserLoginFailRecord.builder().userName(phone).ttl(new Date(dbHelper.getTime() + lockTime)).build());
|
|
|
String msg = resultContent.getMsg();
|
|
|
if (StringUtils.isEmpty(msg)) {
|
|
|
msg = "账号或密码不正确.";
|
|
|
@@ -509,8 +517,7 @@ public class IndexService {
|
|
|
* @return
|
|
|
*/
|
|
|
public ResultContent loginOut() {
|
|
|
- com.github.microservice.auth.client.content.ResultContent<Long> resultContent =
|
|
|
- userService.logoutFromToken(authHelper.getUserToken());
|
|
|
+ com.github.microservice.auth.client.content.ResultContent<Long> resultContent = userService.logoutFromToken(authHelper.getUserToken());
|
|
|
if (resultContent.getState() == ResultState.Success) {
|
|
|
} else {
|
|
|
return ResultContent.buildFail(resultContent.getMsg());
|