diff --git a/src/api/UserApi.ts b/src/api/UserApi.ts index 6d97396..342af04 100644 --- a/src/api/UserApi.ts +++ b/src/api/UserApi.ts @@ -42,18 +42,12 @@ interface LoginInfo { password: string; } -interface LoginRes { - code: number; - expire: string; - token: string; -} - /** * 用户登录 * @param loginInfo * @returns */ -export async function login(loginInfo: LoginInfo): Promise { +export async function login(loginInfo: LoginInfo): Promise { const info = { ...loginInfo, password: encryptPassword(loginInfo.password) }; const response = await api.post(`${UserUriBase}/login`, info); return response.data.token; diff --git a/src/pages/UserLogin.vue b/src/pages/UserLogin.vue index f07e614..1e0c96c 100644 --- a/src/pages/UserLogin.vue +++ b/src/pages/UserLogin.vue @@ -70,7 +70,7 @@ const loginInfo = reactive({ async function doLogin() { try { clearJwtToken(); - const { token } = await login(loginInfo); + const token = await login(loginInfo); saveJwtToken(token); router.push({ name: 'home' }); } catch (err) {