mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
Add server download task creation and related UI components
This commit is contained in:
@@ -666,6 +666,27 @@ class Network {
|
||||
}
|
||||
}
|
||||
|
||||
async createServerDownloadTask(url: string, filename: string, description: string,
|
||||
resourceId: number, storageId: number): Promise<Response<RFile>> {
|
||||
try {
|
||||
const response = await axios.post(`${this.apiBaseUrl}/files/upload/url`, {
|
||||
url,
|
||||
filename,
|
||||
description,
|
||||
resource_id: resourceId,
|
||||
storage_id: storageId
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
catch (e: any) {
|
||||
console.error(e);
|
||||
return {
|
||||
success: false,
|
||||
message: e.toString(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async getFile(fileId: string): Promise<Response<RFile>> {
|
||||
try {
|
||||
const response = await axios.get(`${this.apiBaseUrl}/files/${fileId}`);
|
||||
|
Reference in New Issue
Block a user