From 3755425b0e1deac6b580daa0daed262c1b08c928 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Sat, 10 Oct 2020 14:34:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 7 ++++++- src/components/LiveItem.vue | 24 ++++++++++++++++++++++-- src/components/Menu.vue | 25 +++++++++++++++---------- src/components/NavTop.vue | 4 ++-- src/layout/Regime.vue | 2 +- src/views/login/Login.vue | 5 +---- src/views/regime/Subscriber.vue | 1 + 7 files changed, 48 insertions(+), 20 deletions(-) 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 @@