手机登陆和google登陆参数变更

This commit is contained in:
andy
2026-06-22 17:20:06 +08:00
parent 563b72ff90
commit 8568c07d9f
2 changed files with 14 additions and 6 deletions

View File

@@ -1,11 +1,11 @@
import { storeAuthTokens } from "@/constants/token";
import type { OAuthTokenResponse } from "@/constants/token";
import { request, requestRaw } from "../utils/request";
import { getRequestContext, request, requestRaw } from "../utils/request";
// 获取oauth token
export interface OauthTokenRequest {
grant_type?: string;
openIdCode?: string[];
idToken?: string[];
scope?: string;
mobile?: string;
code?: string;
@@ -34,7 +34,11 @@ export function buildFormUrlEncodedParams(
export async function oauthToken(
data: OauthTokenRequest,
): Promise<OAuthTokenResponse> {
const params = buildFormUrlEncodedParams(data as Record<string, unknown>);
const params = buildFormUrlEncodedParams({
...data,
clientId: data.clientId ?? getRequestContext().clientId ?? "6",
clientConfigld: data.clientConfigld ?? getRequestContext().clientId ?? "6",
} as Record<string, unknown>);
const res = await requestRaw<OAuthTokenResponse>(
{
@@ -66,7 +70,12 @@ export function sendCode(mobile: string) {
url: `/admin/platformUser/sendMobileCode/${encoded}`,
method: "get",
},
{ skipAuth: true },
{
skipAuth: true,
headers: {
clientConfigId: getRequestContext().clientId ?? "",
},
},
);
}