From 7312702c72dc1d76b3abe4dfcb189e92cd813e62 Mon Sep 17 00:00:00 2001 From: zdz Date: Thu, 19 Mar 2026 15:25:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=BF=AB=E6=8D=B7=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/userInfo.ts | 1 + src/utils/api.ts | 18 ++++++++ src/views/common/login.vue | 91 +++++++++++++++++++++++++++++++++++--- 3 files changed, 105 insertions(+), 5 deletions(-) diff --git a/src/stores/userInfo.ts b/src/stores/userInfo.ts index 76cb120..222858f 100644 --- a/src/stores/userInfo.ts +++ b/src/stores/userInfo.ts @@ -6,6 +6,7 @@ export default defineStore('userInfo', { id: '', username: '', password: '', + wxBound: false, roleId: '', realname: '', headPic: '' diff --git a/src/utils/api.ts b/src/utils/api.ts index 1553820..555b173 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -25,6 +25,24 @@ export function sysLogin(data: object) { }) } +// 公众号快捷登录(通过OAuth code) +export function wxH5QuickLogin(params: { code: string }) { + return http.request({ + url: '/wx/h5/quickLogin', + method: 'get', + params + }) +} + +// 当前登录用户绑定微信(通过OAuth code) +export function sysWxBindByCode(params: { code: string }) { + return http.request({ + url: '/sys/wx/bind', + method: 'post', + params + }) +} + export function sysMenuNav() { return http.request({ url: '/sys/menu/nav', diff --git a/src/views/common/login.vue b/src/views/common/login.vue index c80cb06..db78335 100644 --- a/src/views/common/login.vue +++ b/src/views/common/login.vue @@ -18,6 +18,9 @@ 确定 + + 微信快捷登录 + @@ -34,17 +37,76 @@