From 5e4db83a24149164ea0e87b44ec07513517135e0 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Wed, 14 Oct 2020 09:32:12 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=B8=90=E5=8F=B7=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 +- src/api/base.ts | 2 +- src/api/index.ts | 2 +- src/components/Menu.vue | 9 +++++++-- src/store/index.ts | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index 798af9f..8763fb7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,7 +13,7 @@ import { getValue } from './utils/common'; export default defineComponent({ setup(){ if(getValue('token')){ - store.commit("login") + store.commit("login", true) store.dispatch("setUserInfo"); } } diff --git a/src/api/base.ts b/src/api/base.ts index 9c19fd8..a859850 100644 --- a/src/api/base.ts +++ b/src/api/base.ts @@ -10,9 +10,9 @@ export interface Get { } axios.interceptors.response.use((response)=>{ + return response; },(error)=>{ - message.error(error.response.data.message) return Promise.reject(error) }) diff --git a/src/api/index.ts b/src/api/index.ts index f6c0134..289fbd0 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -23,7 +23,7 @@ export async function loginpass(phone: string, password: string){ message.error("存储错误, 请允许网页使用本地存储!") }else{ setToken(); - store.commit("login"); + store.commit("login", true); store.dispatch("setUserInfo"); router.push("/mine/archives") } diff --git a/src/components/Menu.vue b/src/components/Menu.vue index f179fde..1a22d07 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -21,7 +21,7 @@