From a9677fb0fc3ad5513db912bca46b02ca6592c110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E6=88=90=E5=BC=BA?= Date: Mon, 9 Nov 2020 10:17:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 ++ src/components/kpi-layout/NavHeader.vue | 4 ++-- src/store/modules/user.js | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 6819aab..4433fc6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -26,6 +26,7 @@ export default { ...mapState(['user']) }, async created () { + console.log('this', this) if (!dd.other) { await this.handleGetDingtalkCode() await this.handleDingtalkLogin() @@ -77,6 +78,7 @@ export default { let res = await apiUserInfo() console.log('获取用户信息res: ', res) if (res.code === 200) { + console.log('this.SET_USER_INFO: ', this.SET_USER_INFO) this.SET_USER_INFO(res.user) } } diff --git a/src/components/kpi-layout/NavHeader.vue b/src/components/kpi-layout/NavHeader.vue index e95672b..d56a3ea 100644 --- a/src/components/kpi-layout/NavHeader.vue +++ b/src/components/kpi-layout/NavHeader.vue @@ -36,8 +36,8 @@ export default { console.log('this.$router: ', this.$router) console.log('this.$store: ', this.$store) - // history.go(-1) - this.$router.go(-1) + window.history.back() + // this.$router.go(-1) }, open () { const obj = { diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 23af534..b9d2fb4 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -7,6 +7,8 @@ const user = { }, mutations: { SET_USER_INFO: (state, info) => { + console.log('state: ', state) + console.log('info: ', info) localStorage.setItem('info', JSON.stringify(info)) state.info = info },