feat: 增加管理端多语言与风控/报表/奖池操作能力
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { adminRequest } from "@/lib/admin-http";
|
||||
import { adminHttp, adminRequest } from "@/lib/admin-http";
|
||||
import { withAdminAuthHeader } from "@/lib/admin-auth";
|
||||
import { withAdminLocaleHeaders } from "@/lib/admin-locale";
|
||||
|
||||
import { API_V1_PREFIX } from "./paths";
|
||||
|
||||
@@ -21,6 +23,7 @@ export async function getAdminReportJobs(params?: {
|
||||
export async function postAdminReportJob(body: {
|
||||
report_type: string;
|
||||
export_format?: "csv" | "xlsx";
|
||||
parameters?: Record<string, unknown> | null;
|
||||
filter_json?: Record<string, unknown> | null;
|
||||
}): Promise<AdminReportJobCreateResponse> {
|
||||
return adminRequest.post<AdminReportJobCreateResponse>(
|
||||
@@ -28,3 +31,14 @@ export async function postAdminReportJob(body: {
|
||||
body,
|
||||
);
|
||||
}
|
||||
|
||||
export async function downloadAdminReportJob(jobId: number): Promise<Blob> {
|
||||
const res = await adminHttp.request<Blob>(
|
||||
withAdminAuthHeader(withAdminLocaleHeaders({
|
||||
url: `${A}/report-jobs/${jobId}/download`,
|
||||
method: "GET",
|
||||
responseType: "blob",
|
||||
})),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user