增加用户资料修改

This commit is contained in:
yml2213
2026-05-23 09:00:23 +08:00
parent 83b55fa911
commit d1f46fd02e
8 changed files with 336 additions and 15 deletions
+12 -2
View File
@@ -218,8 +218,18 @@ router.beforeEach(async (to) => {
return { path: toMobilePath(to.path), query: to.query, hash: to.hash };
}
if (to.meta.requiresAuth && !localStorage.getItem("access_token")) {
return { path: "/m/login", query: { redirect: to.fullPath } };
if (to.meta.requiresAuth) {
const session = useSessionStore();
if (!session.token) {
return { path: "/m/login", query: { redirect: to.fullPath } };
}
if (!session.phone) {
try {
await session.loadMe();
} catch {
return { path: "/m/login", query: { redirect: to.fullPath } };
}
}
}
if (to.meta.requiresRealname) {