server_commit

This commit is contained in:
zhengziru
2025-04-07 08:51:54 +08:00
parent b865548d20
commit babccdb832
6 changed files with 34 additions and 18 deletions
@@ -138,6 +138,10 @@ public class mobileLoginController {
}
}
if (user.getLoginname().equals(newPwd)) {
return Result.error("请勿以工号作为密码");
}
String pwd = PwdUtil.doSm4CbcEncrypt(newPwd);
dao.update(Sys_user.class, Chain.make("password", pwd).add("weAppLoginCount", user.getWeAppLoginCount() + 1), Cnd.where("id", "=", ShiroUtil.getUserId()));
@@ -154,7 +158,7 @@ public class mobileLoginController {
@RequiresAuthentication
public Object checkIsFirstLogin(){
Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", ShiroUtil.getUserId()));
if (user.getWeAppLoginCount() == 1 && StrUtil.isNotBlank(user.getOpenId())) {
if ((user.getWeAppLoginCount() == null || user.getWeAppLoginCount() == 1) && StrUtil.isNotBlank(user.getOpenId())) {
return Result.error();
} else {
return Result.success();