拆分大文件
This commit is contained in:
@@ -16,6 +16,7 @@ import type {
|
||||
AuthRiskBlockSummary,
|
||||
AuthSessionsResponse,
|
||||
AuthSessionSummary,
|
||||
PublicUserSearchResponse,
|
||||
AuthUser,
|
||||
AuthWechatBindPhoneResponse,
|
||||
AuthWechatStartResponse,
|
||||
@@ -347,6 +348,32 @@ export async function getCurrentAuthUser(): Promise<AuthSessionSnapshot> {
|
||||
};
|
||||
}
|
||||
|
||||
export async function getPublicAuthUserByCode(code: string) {
|
||||
const response = await requestJson<PublicUserSearchResponse>(
|
||||
`/api/auth/public-users/by-code/${encodeURIComponent(code.trim())}`,
|
||||
{
|
||||
method: 'GET',
|
||||
},
|
||||
'读取用户信息失败',
|
||||
PUBLIC_AUTH_REQUEST_OPTIONS,
|
||||
);
|
||||
|
||||
return response.user;
|
||||
}
|
||||
|
||||
export async function getPublicAuthUserById(userId: string) {
|
||||
const response = await requestJson<PublicUserSearchResponse>(
|
||||
`/api/auth/public-users/by-id/${encodeURIComponent(userId.trim())}`,
|
||||
{
|
||||
method: 'GET',
|
||||
},
|
||||
'读取用户信息失败',
|
||||
PUBLIC_AUTH_REQUEST_OPTIONS,
|
||||
);
|
||||
|
||||
return response.user;
|
||||
}
|
||||
|
||||
export async function getAuthSessions() {
|
||||
const response = await requestJson<AuthSessionsResponse>(
|
||||
'/api/auth/sessions',
|
||||
|
||||
Reference in New Issue
Block a user