修改素材云批量上传
This commit is contained in:
@@ -577,4 +577,35 @@ export async function getArea(params?: GetAreaParams): Promise<any> {
|
||||
if (params?.parent_code) query.set('parent_code', params.parent_code);
|
||||
return api.get(`/pre-test-template/getArea?${query.toString()}`);
|
||||
}
|
||||
//
|
||||
|
||||
// ── Upload Material ───────────────────────────────────────
|
||||
|
||||
export interface AsyncBatchUploadTask {
|
||||
advertiser_ids: string[];
|
||||
resource_ids: string[];
|
||||
oauth_id: string;
|
||||
}
|
||||
|
||||
export interface AsyncBatchUploadParams {
|
||||
tasks: AsyncBatchUploadTask[];
|
||||
}
|
||||
|
||||
export async function asyncBatchUploadMaterial(params: AsyncBatchUploadParams): Promise<any> {
|
||||
return api.post('/upload-material/async-batch-upload', params);
|
||||
}
|
||||
|
||||
// 获取上传历史
|
||||
// /api/upload-material/upload-history
|
||||
export interface UploadHistoryParams {
|
||||
status?: string;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
export async function getUploadHistory(params: UploadHistoryParams): Promise<any> {
|
||||
const searchParams = new URLSearchParams();
|
||||
if (params.status) searchParams.set('status', params.status);
|
||||
if (params.page) searchParams.set('page', String(params.page));
|
||||
if (params.pageSize) searchParams.set('page_size', String(params.pageSize));
|
||||
const query = searchParams.toString();
|
||||
return api.get(`/upload-material/upload-history${query ? `?${query}` : ''}`);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ const AuthorizationPage: React.FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
loadOAuthList();
|
||||
handleCallback();
|
||||
}, []);
|
||||
|
||||
const loadOAuthList = async (page = 1, pageSize = 10, params = searchParams) => {
|
||||
@@ -97,22 +96,6 @@ const AuthorizationPage: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleCallback = async () => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const authCode = params.get('auth_code');
|
||||
const state = params.get('state');
|
||||
if (authCode && state) {
|
||||
try {
|
||||
await juliang_callback({ auth_code: authCode, state });
|
||||
message.success('授权成功');
|
||||
window.history.replaceState({}, document.title, window.location.pathname);
|
||||
loadOAuthList();
|
||||
} catch (error) {
|
||||
message.error('授权回调失败');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const handleAuthorize = () => {
|
||||
setShowModal(true);
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user