feat(player): 玩家端短信找回密码

支持手机号验证码重置密码,重置成功后跳转登录页;SMS 增加 reset_password 场景与 purpose 隔离。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-12 13:12:00 +08:00
parent e140861a2b
commit ff89c31b51
16 changed files with 597 additions and 13 deletions

View File

@@ -6,6 +6,7 @@ const router = createRouter({
routes: [
{ path: '/login', component: () => import('../views/LoginView.vue') },
{ path: '/register', component: () => import('../views/RegisterView.vue') },
{ path: '/forgot-password', component: () => import('../views/ForgotPasswordView.vue') },
{
path: '/',
component: () => import('../layouts/MainLayout.vue'),
@@ -34,7 +35,7 @@ const router = createRouter({
router.beforeEach((to) => {
const auth = useAuthStore();
if ((to.path === '/login' || to.path === '/register') && auth.token) return '/';
if ((to.path === '/login' || to.path === '/register' || to.path === '/forgot-password') && auth.token) return '/';
// 需要登录的页面 — 未登录时弹出登录提示,留在当前页
if (to.meta.requiresAuth && !auth.token) {
auth.showLoginPrompt(to.fullPath);