管理员默认密码 admin/admin,首次登录强制改密码;增加服务器部署配置
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,12 @@ const routes: RouteRecordRaw[] = [
|
||||
component: () => import('@/views/LoginView.vue'),
|
||||
meta: { layout: 'blank', public: true },
|
||||
},
|
||||
{
|
||||
path: '/change-password',
|
||||
name: 'change-password',
|
||||
component: () => import('@/views/ChangePasswordView.vue'),
|
||||
meta: { layout: 'blank' },
|
||||
},
|
||||
{ path: '/', redirect: '/scores' },
|
||||
{
|
||||
path: '/scores',
|
||||
@@ -44,6 +50,9 @@ router.beforeEach((to) => {
|
||||
if (!auth.token) {
|
||||
return { path: '/login', query: { redirect: to.fullPath } }
|
||||
}
|
||||
if (auth.requirePasswordChange && to.path !== '/change-password') {
|
||||
return { path: '/change-password' }
|
||||
}
|
||||
if (to.meta.adminOnly && !auth.isAdmin) {
|
||||
return { path: '/scores' }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user