diff --git a/frontend-vue/src/pages/brand/components/BrandBrandTab.vue b/frontend-vue/src/pages/brand/components/BrandBrandTab.vue index 20615357..b66489f1 100644 --- a/frontend-vue/src/pages/brand/components/BrandBrandTab.vue +++ b/frontend-vue/src/pages/brand/components/BrandBrandTab.vue @@ -286,7 +286,7 @@ async function uploadBrandPathsToJava(paths: Array ({ fileKey: f.fileKey, originalFilename: f.originalFilename, relativePath: f.relativePath, - fileUrl: f.localPath, + fileUrl: f.url || f.localPath, })) if (runMode.value === 'immediate') { const res = await runBrandNow(files, strategy.value) diff --git a/frontend-vue/src/shared/bridges/pywebview.ts b/frontend-vue/src/shared/bridges/pywebview.ts index 5eabd2c4..5555c772 100644 --- a/frontend-vue/src/shared/bridges/pywebview.ts +++ b/frontend-vue/src/shared/bridges/pywebview.ts @@ -93,6 +93,7 @@ export interface PywebviewApi { upload_file_to_java?: ( filePath: string, relativePath?: string, + uploadOss?: boolean, ) => Promise<{ success: boolean; message?: string; diff --git a/frontend-vue/src/shared/bridges/web-fallback.ts b/frontend-vue/src/shared/bridges/web-fallback.ts index 52379a3d..36d79e1d 100644 --- a/frontend-vue/src/shared/bridges/web-fallback.ts +++ b/frontend-vue/src/shared/bridges/web-fallback.ts @@ -125,8 +125,8 @@ export const webFallbackApi: PywebviewApi = { return registerWebFiles(files) }, - /** 虚拟路径 → 浏览器 File → 上传 Java 临时目录;返回结构与桌面桥一致(透传 Java ApiResponse) */ - async upload_file_to_java(filePath, relativePath) { + /** 虚拟路径 → 浏览器 File → 上传 Java;uploadOss=true 时同时上传公开 OSS(品牌检测等服务端化工具用) */ + async upload_file_to_java(filePath, relativePath, uploadOss) { const file = typeof filePath === 'string' ? webFileMap.get(filePath) : undefined if (!file) { return { success: false, error: '文件不存在,请重新选择' } @@ -136,6 +136,10 @@ export const webFallbackApi: PywebviewApi = { if (relativePath) { form.append('relativePath', relativePath) } + if (uploadOss) { + form.append('uploadToOss', 'true') + form.append('moduleType', 'BRAND') + } try { // http 实例对 /newApi 前缀自动附带 Bearer;FormData 的 Content-Type 交由浏览器自动生成(含 boundary) const response = await http.post('/newApi/api/files/upload', form, { timeout: 120000 })