add verification support

This commit is contained in:
AceDataCloud committed 2022-04-05 19:38:04 +08:00
1 parent 91a5420a76
commit cc43fb39e8
10 files changed
+98 -29

No files matched your search

+6 -1
View File
@@ -1,6 +1,7 @@
import { createStore, ActionContext } from 'vuex';
import { IUser } from '@/services/user/types';
import { IUser, IUserDetailResponse } from '@/services/user/types';
import createPersistedState from 'vuex-persistedstate';
import UserService from '@/services/user/service';
export interface IState {
accessToken: string | undefined;
@@ -44,6 +45,10 @@ const store = createStore({
},
setUser({ commit }: ActionContext<IState, IState>, payload: IUser) {
commit('setUser', payload);
},
async getMe({ commit }: ActionContext<IState, IState>) {
const { data: data } = await UserService.getMe();
commit('setUser', data);
}
},
getters: {