diff --git a/src/api/index.ts b/src/api/index.ts index a0032d0..37f2b3e 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -24,6 +24,7 @@ export async function loginpass(phone: string, password: string){ }else{ setToken(); store.commit("login"); + store.dispatch("setUserInfo"); router.push("/mine/archives") } } @@ -34,7 +35,11 @@ export async function loginpass(phone: string, password: string){ */ export async function userinfo(){ const user = await get('personalInfo'); - console.log(user.data?.img) + // console.log(user.data?.img) + if(user.code == 1001){ + router.push("/") + return '未登录'; + } return { head: user.data?.img, username: user.data?.name, diff --git a/src/components/LiveItem.vue b/src/components/LiveItem.vue index 4f3d048..dc886ea 100644 --- a/src/components/LiveItem.vue +++ b/src/components/LiveItem.vue @@ -1,5 +1,5 @@