|
|
@@ -2,7 +2,7 @@
|
|
|
* Web 端:Tus 分片上传(与 Apifox / uni 版协议对齐);独立审核走上传服务 /upload/simple 等,不再调用 verify 审核域
|
|
|
*/
|
|
|
import { useUserStore } from "@/stores/modules/user";
|
|
|
-import { AI_UPLOAD_FILES_PUBLIC_BASE, BASE_AI_URL, BASE_DEV_UPLOAD_SIMPLE } from "@/utils/config";
|
|
|
+import { AI_UPLOAD_FILES_PUBLIC_BASE, BASE_AI_URL, SIMPLE_UPLOAD_REQUEST_BASE } from "@/utils/config";
|
|
|
import { withSimpleUploadOverlay } from "@/utils/withSimpleUploadOverlay";
|
|
|
|
|
|
const TUS_VERSION = "1.0.0";
|
|
|
@@ -120,16 +120,13 @@ function normalizeSimpleUploadUrls(body: unknown, fileUrl: string): { fileUrl: s
|
|
|
const DEV_SIMPLE_UPLOAD_PATH = "/upload/simple";
|
|
|
|
|
|
function buildDevSimpleUploadRequestUrl(): string {
|
|
|
- const base = String(BASE_DEV_UPLOAD_SIMPLE || "").replace(/\/$/, "");
|
|
|
- if (base) {
|
|
|
- return `${base}${DEV_SIMPLE_UPLOAD_PATH}`;
|
|
|
- }
|
|
|
- return DEV_SIMPLE_UPLOAD_PATH;
|
|
|
+ const base = String(SIMPLE_UPLOAD_REQUEST_BASE || "").replace(/\/$/, "");
|
|
|
+ return `${base}${DEV_SIMPLE_UPLOAD_PATH}`;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 官方相册等:multipart 直传(替代 Tus `POST .../upload`)
|
|
|
- * POST `/dev-upload-ailien/upload/simple`,表单字段 `file`
|
|
|
+ * POST `https://uat.ailien.shop/upload/simple`(与全局 simple 上传一致),表单字段 `file`
|
|
|
*/
|
|
|
export async function uploadFileViaDevSimpleEndpoint(file: File): Promise<{ fileUrl: string; coverUrl?: string }> {
|
|
|
return withSimpleUploadOverlay(async signal => {
|