统一端口设置,可以设置自义定端口

This commit is contained in:
2025-08-24 20:38:28 +08:00
parent a35e82731d
commit 275a3672d2
12 changed files with 284 additions and 291 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import apiService from './api';
import apiService, { getApiBaseUrl } from './api';
import type { DownloadTask } from '@/types';
class DownloadService {
@@ -132,7 +132,7 @@ class DownloadService {
* 使用SSE监听下载进度
*/
streamTaskProgress(taskId: string, onProgress: (task: DownloadTask) => void, onComplete?: () => void) {
const eventSource = new EventSource(`http://localhost:3000/api/download/stream/${taskId}`);
const eventSource = new EventSource(`${getApiBaseUrl()}/api/download/stream/${taskId}`);
eventSource.onmessage = (event) => {
try {