管理员默认密码 admin/admin,首次登录强制改密码;增加服务器部署配置

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-05-03 17:44:08 +08:00
parent ff09715511
commit d742d4972c
14 changed files with 350 additions and 49 deletions

View File

@@ -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' }
}