|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.glxp.api.admin.controller.auth;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUnit;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.crypto.SecureUtil;
|
|
|
|
|
import com.glxp.api.admin.entity.auth.AuthCheckEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.info.DeviceKeyEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity;
|
|
|
|
@ -73,7 +75,7 @@ public class LoginController {
|
|
|
|
|
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(authAdmin.getPassWord())) {
|
|
|
|
|
if (!PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(SecureUtil.md5().digestHex(authAdmin.getPassWord()))) {
|
|
|
|
|
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
|
|
|
|
|
}
|
|
|
|
|
if (authAdmin.getUserFlag() == 0) {
|
|
|
|
@ -115,6 +117,8 @@ public class LoginController {
|
|
|
|
|
loginResponse.setToken(token);
|
|
|
|
|
loginResponse.setDept(authAdmin.getDept());
|
|
|
|
|
loginResponse.setDeptName(authAdmin.getDeptName());
|
|
|
|
|
loginResponse.setNeedChangePwd(cn.hutool.core.date.DateUtil.between(authAdmin.getLastUpdatePwdTime() == null ? cn.hutool.core.date.DateUtil.date():authAdmin.getLastUpdatePwdTime()
|
|
|
|
|
, cn.hutool.core.date.DateUtil.date(), DateUnit.DAY)>=90);
|
|
|
|
|
return ResultVOUtils.success(loginResponse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -265,7 +269,8 @@ public class LoginController {
|
|
|
|
|
authAdminUp.setId(authAdmin.getId());
|
|
|
|
|
String newPwd = PasswordUtils.authAdminPwd(updatePasswordRequest.getNewPassword());
|
|
|
|
|
authAdminUp.setPassWord(newPwd);
|
|
|
|
|
authAdmin.setLastModifyTime(new Date());
|
|
|
|
|
authAdminUp.setLastModifyTime(new Date());
|
|
|
|
|
authAdminUp.setLastUpdatePwdTime(new Date());
|
|
|
|
|
boolean b = authAdminService.updateAuthAdmin(authAdminUp);
|
|
|
|
|
if (b) {
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|