refine auth
This commit is contained in:
1 parent
679faf9fc2
commit
6bd5bb0aa0
9 files changed
+20
-98
No files matched your search
+9
-3
@@ -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: {
|
||||
|
||||
Reference in new issue
Block a user