From 7d445240461074be95199effe91beea00abe58ce Mon Sep 17 00:00:00 2001 From: zhangyahui Date: Wed, 5 Nov 2025 10:24:53 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E8=B0=B7=E6=AD=8C=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env.d.ts | 27 ++++ src/views/login/components/GoogleLogin.vue | 177 +++++++++++++++++---- 2 files changed, 176 insertions(+), 28 deletions(-) diff --git a/env.d.ts b/env.d.ts index 11f02fe..4d291ae 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1 +1,28 @@ /// + +// Google Identity Services 类型声明 +interface GoogleAccounts { + accounts: { + id: { + initialize: (config: { + client_id: string + auto_select?: boolean + callback: (response: { credential: string }) => void + ux_mode?: 'popup' | 'redirect' + itp_support?: boolean + }) => void + renderButton: (element: Element | null, config: { + type?: 'standard' | 'icon' + shape?: 'rectangular' | 'pill' | 'circle' | 'square' + theme?: 'outline' | 'filled_blue' | 'filled_black' + size?: 'large' | 'medium' | 'small' + logo_alignment?: 'left' | 'center' + }) => void + } + } +} + +interface Window { + google?: GoogleAccounts + isAddGmail?: boolean +} \ No newline at end of file diff --git a/src/views/login/components/GoogleLogin.vue b/src/views/login/components/GoogleLogin.vue index 8562882..5e8da87 100644 --- a/src/views/login/components/GoogleLogin.vue +++ b/src/views/login/components/GoogleLogin.vue @@ -1,5 +1,5 @@