From 3293e2fb564fbc3cff4a9268b6595ff7f99b37b2 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Fri, 23 May 2025 10:19:47 +0800
Subject: [PATCH] 账号密码支持自定义更新周期
---
ruoyi-ui/src/store/modules/user.js | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/ruoyi-ui/src/store/modules/user.js b/ruoyi-ui/src/store/modules/user.js
index 1b3a566..1fff758 100644
--- a/ruoyi-ui/src/store/modules/user.js
+++ b/ruoyi-ui/src/store/modules/user.js
@@ -1,3 +1,5 @@
+import router from '@/router'
+import { MessageBox, } from 'element-ui'
import { login, logout, getInfo, refreshToken } from '@/api/login'
import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth'
import { isEmpty } from "@/utils/validate"
@@ -27,7 +29,7 @@
SET_NAME: (state, name) => {
state.name = name
},
- SET_NICK_NAME: (state, nickName) =>{
+ SET_NICK_NAME: (state, nickName) => {
state.nickName = nickName
},
SET_AVATAR: (state, avatar) => {
@@ -78,6 +80,18 @@
commit('SET_NAME', user.userName)
commit('SET_NICK_NAME', user.nickName)
commit('SET_AVATAR', avatar)
+ /* 初始密码提示 */
+ if(res.isDefaultModifyPwd) {
+ MessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
+ router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } })
+ }).catch(() => {})
+ }
+ /* 过期密码提示 */
+ if(!res.isDefaultModifyPwd && res.isPasswordExpired) {
+ MessageBox.confirm('您的密码已过期,请尽快修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
+ router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } })
+ }).catch(() => {})
+ }
resolve(res)
}).catch(error => {
reject(error)
--
Gitblit v1.9.3