初始密码支持自定义修改策略

This commit is contained in:
RuoYi
2025-05-22 23:09:24 +08:00
parent dbe3df5edd
commit 37c94666fb
3 changed files with 19 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
import router from '@/router'
import { ElMessageBox, } from 'element-plus'
import { login, logout, getInfo } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
import { isHttp, isEmpty } from "@/utils/validate"
@@ -51,6 +53,12 @@ const useUserStore = defineStore(
this.name = user.userName
this.nickName = user.nickName
this.avatar = avatar
/* 初始密码提示 */
if(res.isDefaultModifyPwd) {
ElMessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } })
}).catch(() => {})
}
resolve(res)
}).catch(error => {
reject(error)