手机登陆和google登陆参数变更
This commit is contained in:
@@ -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 ?? "",
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user