Commit df85893d authored by chenqikuai's avatar chenqikuai

fix: 修复退出后 用户头像没有清理的bug

parent 1eccab08
......@@ -51,6 +51,9 @@ export default new Vuex.Store({
save(state: any, payload) {
Object.assign(state, payload);
},
clearAuthInfo(state: any) {
state.authInfo = {};
},
},
actions: {
getUserInfo({ commit }) {
......
......@@ -44,6 +44,7 @@ export default class AccountNum extends Vue {
@Action('getUserInfo') private getUserInfo!: () => void;
@Mutation('updateIsLogin') private updateIsLogin!: (isLogin: boolean) => void;
@Mutation('updateUserInfo') private updateUserInfo!: (userInfo: any) => void;
@Mutation('clearAuthInfo') private clearAuthInfo!: () => void;
@Template.Mutation("clearData") private clearTemplateData!: ()=> void;
private option: any = {
......@@ -63,7 +64,13 @@ export default class AccountNum extends Vue {
private logout() {
localStorage.removeItem('userInfo');
this.updateIsLogin(false);
this.updateUserInfo({});
this.updateUserInfo({
phone: '',
icon: '',
email: '',
auth_type: 0,
});
this.clearAuthInfo();
this.clearTemplateData();
this.$router.replace({path: '/'});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment