refine auth

This commit is contained in:
AceDataCloud committed 2023-01-26 00:24:23 +08:00
1 parent 679faf9fc2
commit 6bd5bb0aa0
9 files changed
+20 -98

No files matched your search

+9 -3
View File
@@ -45,9 +45,15 @@ const store = createStore({
setUser({ commit }: ActionContext<IState, IState>, payload: IUser) {
commit('setUser', payload);
},
async getMe({ commit }: ActionContext<IState, IState>) {
const { data: data } = await userOperator.getMe();
commit('setUser', data);
getMe({ commit }: ActionContext<IState, IState>) {
userOperator
.getMe()
.then(({ data: data }) => {
commit('setUser', data);
})
.catch(() => {
console.error('failed to get user info');
});
}
},
getters: {