From c85a5dd048f5adfc75425e46bc6057dda23d3e87 Mon Sep 17 00:00:00 2001 From: wangtaocs Date: Fri, 29 Nov 2024 16:26:26 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=99=BB=E5=BD=95=E4=BB=A3=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/auth/index.ts | 4 ++-- src/store/modules/user.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/api/auth/index.ts b/src/api/auth/index.ts index 12c7a62..7f8ae3a 100644 --- a/src/api/auth/index.ts +++ b/src/api/auth/index.ts @@ -26,9 +26,9 @@ const AuthAPI = { * @param code 微信登录code * @returns 返回 token */ - wxlogin(code: string): Promise { + wechatLogin(code: string): Promise { return request({ - url: "/api/v1/auth/wxlogin", + url: "/api/v1/auth/wechat-login", method: "POST", data: { code }, header: { diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 3644460..e1e0f85 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -24,7 +24,7 @@ export const useUserStore = defineStore("user", () => { // 微信登录 const loginByWechat = (code: string) => { return new Promise((resolve, reject) => { - AuthAPI.wxlogin(code) + AuthAPI.wechatLogin(code) .then((data) => { setToken(data.accessToken); resolve(data); @@ -34,7 +34,6 @@ export const useUserStore = defineStore("user", () => { reject(error); }); }); - // return AuthAPI.wxlogin(code); }; // 获取用户信息