|
@@ -13,10 +13,8 @@ const DEFAULT: UserState = {
|
|
|
|
|
|
|
|
const actions: ActionTree<UserState, RootState> = {
|
|
const actions: ActionTree<UserState, RootState> = {
|
|
|
async updateUserInfo({ commit }) {
|
|
async updateUserInfo({ commit }) {
|
|
|
- const res = (await UserAPI.getUserInfo()) as unknown as {
|
|
|
|
|
- user_info: UserState;
|
|
|
|
|
- };
|
|
|
|
|
- commit('updateUserInfo', res.user_info);
|
|
|
|
|
|
|
+ const userinfo = await UserAPI.getUserInfo();
|
|
|
|
|
+ commit('updateUserInfo', userinfo);
|
|
|
},
|
|
},
|
|
|
userLogOut({ commit }) {
|
|
userLogOut({ commit }) {
|
|
|
commit('updateUserInfo', DEFAULT);
|
|
commit('updateUserInfo', DEFAULT);
|
|
@@ -25,9 +23,9 @@ const actions: ActionTree<UserState, RootState> = {
|
|
|
|
|
|
|
|
const mutations: MutationTree<UserState> = {
|
|
const mutations: MutationTree<UserState> = {
|
|
|
updateUserInfo(state, {
|
|
updateUserInfo(state, {
|
|
|
- name, email, id, phone, role,
|
|
|
|
|
|
|
+ username, email, id, phone, role,
|
|
|
}) {
|
|
}) {
|
|
|
- state.username = name;
|
|
|
|
|
|
|
+ state.username = username;
|
|
|
state.email = email;
|
|
state.email = email;
|
|
|
state.id = id;
|
|
state.id = id;
|
|
|
state.phone = phone;
|
|
state.phone = phone;
|