diff --git a/src/api/platform/core/controller/user.ts b/src/api/platform/core/controller/user.ts index 17363fd..eb1ead4 100644 --- a/src/api/platform/core/controller/user.ts +++ b/src/api/platform/core/controller/user.ts @@ -49,7 +49,7 @@ export const login = (params: LoginParams) => { export const getUserInfo = () => defHttp.get({ url: Api.getUserInfo }); /** 登出 */ -export const logout = () => defHttp.delete({ url: Api.logout }, { errorMessageMode: 'none'}); +export const logout = () => defHttp.delete({ url: Api.logout }); /** 获取验证码 */ export const getCaptcha = () => defHttp.get({ url: `${Api.getCaptcha}?key=${Date.now()}` }); diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 1430f74..7252be2 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -181,11 +181,7 @@ export const useUserStore = defineStore({ }, /** 登出 */ async logout(goLogin = false) { - try { - await logout(); - } catch { - console.log('注销Token失败'); - } + await logout(); this.resetState(); goLogin && await router.push(PageEnum.BASE_LOGIN); },