feat: 配置控制首次登录密码修改

This commit is contained in:
TsMask
2025-04-18 17:09:30 +08:00
parent b708c8924b
commit e30069603d
6 changed files with 19 additions and 12 deletions

View File

@@ -79,7 +79,7 @@ func (s AccountController) Login(c *gin.Context) {
if !config.IsSystemUser(loginUser.UserId) {
// 强制改密码
forcePasswdChange, err := s.accountService.PasswordExpireTime(loginUser.User.LoginCount, loginUser.User.PasswordUpdateTime)
forcePasswdChange, err := s.accountService.PasswordCountOrExpireTime(loginUser.User.LoginCount, loginUser.User.PasswordUpdateTime)
if err != nil {
c.JSON(200, resp.ErrMsg(i18n.TKey(language, err.Error())))
return
@@ -149,7 +149,7 @@ func (s AccountController) Me(c *gin.Context) {
if !isSystemUser {
// 强制改密码
forcePasswdChange, _ := s.accountService.PasswordExpireTime(info.User.LoginCount, info.User.PasswordUpdateTime)
forcePasswdChange, _ := s.accountService.PasswordCountOrExpireTime(info.User.LoginCount, info.User.PasswordUpdateTime)
if forcePasswdChange {
data["forcePasswdChange"] = true
}