From 8a7186c1b1861c6982cd0ec5f2ebe0711ba0bf99 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Wed, 22 Dec 2021 21:19:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=B0=E4=BD=8F=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/assets/js/pages/login.vue | 3 ++- resources/assets/js/store/actions.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/pages/login.vue b/resources/assets/js/pages/login.vue index db3cb1ce..3d9c6c14 100644 --- a/resources/assets/js/pages/login.vue +++ b/resources/assets/js/pages/login.vue @@ -59,7 +59,7 @@ export default { codeUrl: this.$store.state.method.apiUrl('users/login/codeimg'), loginType: 'login', - email: '', + email: this.$store.state.method.getStorageString("cacheLoginEmail") || '', password: '', password2: '', code: '', @@ -143,6 +143,7 @@ export default { }, }).then(({data}) => { this.loadIng--; + this.$store.state.method.setStorage("cacheLoginEmail", this.email) this.$store.dispatch("handleClearCache", data).then(() => { this.goNext(); }).catch(() => { diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index 0bf4543f..999185e3 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -388,6 +388,8 @@ export default { handleClearCache({state, dispatch}, userInfo) { return new Promise(function (resolve, reject) { try { + const cacheLoginEmail = state.method.getStorageString("cacheLoginEmail"); + // window.localStorage.clear(); // state.cacheUserBasic = []; @@ -397,6 +399,7 @@ export default { state.cacheTasks = state.tasks = state.taskSubs = []; // state.method.setStorage("cacheTablePanel", state.cacheTablePanel); + state.method.setStorage("cacheLoginEmail", cacheLoginEmail); dispatch("saveUserInfo", state.method.isJson(userInfo) ? userInfo : state.userInfo); // resolve()