export type CreateApiV1AccountPasswordResetArgs = {body: {accountType?: (0 | 1 | 4 | 5) | undefined, code?: string | undefined, email?: string | undefined, newPassword?: string | undefined}}; export type CreateApiV1AccountPasswordResetOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * 使用邮箱验证码重置密码 * * POST /v1/account/password/reset */ export const createApiV1AccountPasswordReset = async (args: CreateApiV1AccountPasswordResetArgs, options: CreateApiV1AccountPasswordResetOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/account/password/reset${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };