feat: 为通知路由添加认证要求,确保用户登录后才能访问
This commit is contained in:
@@ -36,6 +36,7 @@ const routes: Array<RouteRecordRaw> = [
|
|||||||
{
|
{
|
||||||
path: "notify",
|
path: "notify",
|
||||||
component: () => import("@/views/notify/index.vue"),
|
component: () => import("@/views/notify/index.vue"),
|
||||||
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "user",
|
path: "user",
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ export const useUserStore = defineStore("user", () => {
|
|||||||
const isAuthenticated = computed(() => !!token.value);
|
const isAuthenticated = computed(() => !!token.value);
|
||||||
|
|
||||||
async function updateProfile() {
|
async function updateProfile() {
|
||||||
|
const { initializeWallet } = useWalletStore();
|
||||||
const { data } = await safeClient(client.api.user.profile.get(), { silent: true });
|
const { data } = await safeClient(client.api.user.profile.get(), { silent: true });
|
||||||
state.userProfile = data.value || null;
|
state.userProfile = data.value || null;
|
||||||
|
initializeWallet();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setToken(value: string) {
|
function setToken(value: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user