Commit 5a25f7d1 by 初志鑫

简化userInfo接口

parent 0d2481de
......@@ -13,13 +13,10 @@ export async function login(data) {
});
}
export function getUserInfo(accessToken) {
export function getUserInfo() {
return request({
url: "/userInfo",
method: "post",
data: {
accessToken,
},
});
}
......
......@@ -68,8 +68,8 @@ const actions = {
);
}
},
async getUserInfo({ commit, state }) {
const { data } = await getUserInfo(state.accessToken);
async getUserInfo({ commit }) {
const { data } = await getUserInfo();
if (!data) {
Vue.prototype.$baseMessage("验证失败,请重新登录...", "error");
return false;
......@@ -87,7 +87,6 @@ const actions = {
},
async logout({ dispatch }) {
await logout(state.accessToken);
await dispatch("tagsBar/delAllRoutes", null, { root: true });
await dispatch("resetAccessToken");
await resetRouter();
},
......
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