From ebd7c2bf2a71a845a405c8c8dc63442049582b11 Mon Sep 17 00:00:00 2001 From: DEV_DSW <562304744@qq.com> Date: Tue, 2 Jun 2026 17:01:43 +0800 Subject: [PATCH] refactor: remove unused clientId from oauth token requests remove clientId field from OauthTokenRequest interface and all oauthToken call sites, as it is no longer required for the API requests. --- src/api/login.ts | 1 - src/pages/login/index.vue | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/api/login.ts b/src/api/login.ts index e96ab3e..0e7c50c 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -2,7 +2,6 @@ import { request } from "../utils/request"; // 获取oauth token export interface OauthTokenRequest { - clientId: string; grant_type?: string; openIdCode?: string[]; scope?: string; diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index df91535..8774bcc 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -213,7 +213,6 @@ async function handlePhoneLogin() { try { await oauthToken({ - clientId: import.meta.env.VITE_CLIENT_ID, scope: "server", mobile: phoneDigits, code: codeValue, @@ -301,7 +300,7 @@ onMounted(() => { // 【后续业务】:你可以将这串 idToken 通过 axios 发送给你自己的后端接口 // 或者是直接利用第三方平台(如 Firebase / Supabase)完成纯前端鉴权 console.log("拿到的 ID Token 是:", idToken); - oauthToken({ clientId: import.meta.env.VITE_CLIENT_ID, openIdCode: [idToken], grant_type: 'google' }) + oauthToken({ openIdCode: [idToken], grant_type: 'google' }) .then((res) => { console.log("获取到的 oauth token:", res)