mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-10 20:57:10 +08:00
feat:新增密码过期修改页面逻辑
This commit is contained in:
@@ -53,6 +53,11 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
component: () => import('@/views/login/social/index.vue'),
|
||||
meta: { hidden: true }
|
||||
},
|
||||
{
|
||||
path: '/pwdExpired',
|
||||
component: () => import('@/views/login/pwdExpired/index.vue'),
|
||||
meta: { hidden: true }
|
||||
},
|
||||
{
|
||||
path: '/setting',
|
||||
name: 'Setting',
|
||||
|
@@ -1,10 +1,11 @@
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import router from '@/router'
|
||||
import { useRouteStore, useUserStore } from '@/stores'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { isHttp } from '@/utils/validate'
|
||||
|
||||
/** 免登录白名单 */
|
||||
const whiteList = ['/login', '/social/callback']
|
||||
const whiteList = ['/login', '/social/callback', '/pwdExpired']
|
||||
|
||||
/** 是否已经生成过路由表 */
|
||||
let hasRouteFlag = false
|
||||
@@ -25,6 +26,10 @@ router.beforeEach(async (to, from, next) => {
|
||||
if (!hasRouteFlag) {
|
||||
try {
|
||||
await userStore.getInfo()
|
||||
if (userStore.userInfo.pwdExpired && to.path !== '/pwdExpired') {
|
||||
Message.warning('密码已过期,请修改密码')
|
||||
next('/pwdExpired')
|
||||
}
|
||||
const accessRoutes = await routeStore.generateRoutes()
|
||||
accessRoutes.forEach((route) => {
|
||||
if (!isHttp(route.path)) {
|
||||
|
Reference in New Issue
Block a user