fix: 密码过期情况下,标记用户选择是否修改密码

This commit is contained in:
kils
2024-05-09 18:05:53 +08:00
committed by Charles7c
parent 395a5642af
commit c64cf9da34
3 changed files with 30 additions and 22 deletions

View File

@@ -98,6 +98,32 @@ const logout = () => {
}
})
}
onMounted(() => {
checkPasswordExpired()
})
const checkPasswordExpired = () => {
if (!userStore.passwordExpiredShow || !userStore.userInfo.passwordExpired) {
return
}
Modal.confirm({
title: '提示',
content: '密码已过期,是否去修改?',
hideCancel: false,
closable: true,
onBeforeOk: async () => {
try {
await router.push({ path: '/setting/profile' })
return true
} catch (error) {
return false
}
},
onCancel: () => {
// 当前登录会话不再提示
userStore.passwordExpiredShow = false
}
})
}
</script>
<style lang="scss" scoped>