feat: 记住最后登录账号
This commit is contained in:
parent
c120686fae
commit
8a7186c1b1
@ -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(() => {
|
||||
|
3
resources/assets/js/store/actions.js
vendored
3
resources/assets/js/store/actions.js
vendored
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user