|
|
|
@ -2,6 +2,7 @@ package com.glxp.sale.admin.controller.auth;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUnit;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.crypto.SecureUtil;
|
|
|
|
|
import com.glxp.sale.admin.annotation.AuthRuleAnnotation;
|
|
|
|
|
import com.glxp.sale.admin.dao.auth.AuthLicenseDao;
|
|
|
|
|
import com.glxp.sale.admin.entity.auth.AuthAdmin;
|
|
|
|
@ -109,7 +110,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, "用户名或密码错误");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -147,8 +148,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);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|