增加用户资料修改
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user