From 257c2d51ef1ebce60a73765eecabcedb0e8554be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E6=88=90=E5=BC=BA?= Date: Fri, 20 Nov 2020 10:29:45 +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 | 6 +++--- src/store/modules/user.js | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/App.vue b/src/App.vue index 27dc7a5..5e5decd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,9 +1,9 @@ diff --git a/src/store/modules/user.js b/src/store/modules/user.js index c3362d5..5c66d90 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,20 +1,21 @@ import { getDepList } from '@/api/report' import { apiUserInfo } from '@/api/login' +import * as dd from 'dingtalk-jsapi' const user = { state: { deplist: [], - info: {}, + info: dd.other ? JSON.parse(localStorage.getItem('info')) : {}, auth: JSON.parse(localStorage.getItem('auth')) || {} }, mutations: { SET_USER_INFO: (state, info) => { - localStorage.setItem('info', JSON.stringify(info)) + dd.other && localStorage.setItem('info', JSON.stringify(info)) state.info = info console.log('state.info: ', state.info) }, SET_USER_AUTH: (state, auth) => { - localStorage.setItem('auth', JSON.stringify(auth)) + dd.other && localStorage.setItem('auth', JSON.stringify(auth)) state.auth = auth console.log('state.auth: ', state.auth) },