[优化] 增加根目录选项

This commit is contained in:
ryan
2026-06-04 09:56:03 +08:00
parent e117e314d9
commit 6e85f1158b
10 changed files with 186 additions and 13 deletions
@@ -42,12 +42,14 @@ export function getPagesDeployments(projectId: number) {
export function uploadPagesDeployment(
projectId: number,
file: File,
rootDir = '',
entryFile = 'index.html',
onProgress?: (percent: number) => void,
) {
if (!onProgress) {
const formData = new FormData();
formData.append('package', file);
formData.append('root_dir', rootDir);
formData.append('entry_file', entryFile);
return apiRequest<PagesDeployment>(
`/pages/${projectId}/deployments/upload`,
@@ -61,6 +63,7 @@ export function uploadPagesDeployment(
return new Promise<PagesDeployment>((resolve, reject) => {
const formData = new FormData();
formData.append('package', file);
formData.append('root_dir', rootDir);
formData.append('entry_file', entryFile);
const xhr = new XMLHttpRequest();