From ed73e963767fb6adb6a2f96693ca02a3f51714a2 Mon Sep 17 00:00:00 2001 From: Rodger-Wang <1367893453@qq.com> Date: Sun, 4 Oct 2026 22:11:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(console)=EF=BC=9A=E5=9B=BA=E4=BB=B6?= =?UTF-8?q?=E5=92=8C=E4=BA=A7=E5=93=81=E5=9B=BE=E6=8C=89=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E7=9A=84=E5=BA=94=E7=94=A8=E5=88=86=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E4=B8=8D=E5=86=8D=E5=86=99=E6=AD=BB=20EAIMAR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- apps/admin/app/composables/useApi.ts | 8 +- apps/admin/app/pages/product.vue | 45 ++++- apps/services/comm/ossconf.go | 7 +- apps/services/modules/console/api_upload.go | 186 +++++++++++++++--- .../modules/console/api_upload_test.go | 78 ++++++++ 5 files changed, 284 insertions(+), 40 deletions(-) diff --git a/apps/admin/app/composables/useApi.ts b/apps/admin/app/composables/useApi.ts index bd30239f..6704ccfe 100644 --- a/apps/admin/app/composables/useApi.ts +++ b/apps/admin/app/composables/useApi.ts @@ -99,10 +99,10 @@ export function useApi() { opts: { target?: string; appName?: string; onProgress?: (percent: number) => void } = {}, ): Promise { const contentType = file.type || 'application/octet-stream' - // ⚠️ opts.appName 是页面上选中的应用名,安装包上传必须带: - // X-App-Id 头来自登录态的 currentAppId,只有绑定了应用的运营/代理账号才有; - // 超管在页面顶部选的应用只是个 app_name 字符串,不会进请求头, - // 不带 app_name 的话超管传包必然被后端拒成「必须先选择应用」。 + // opts.appName:安装包是页面上选中的应用;固件/产品图是产品绑定的应用名。 + // 安装包这条:X-App-Id 只有绑定了应用的运营/代理账号才有,超管页面上选的应用 + // 不会进请求头,不带 app_name 就会被拒成「必须先选择应用」。 + // 固件/产品图的目录由服务端按产品 appnames 决定,不看登录态的 X-App-Id。 const token = await webApi<{ upload_url?: string url?: string diff --git a/apps/admin/app/pages/product.vue b/apps/admin/app/pages/product.vue index 71dc7d25..1d406424 100644 --- a/apps/admin/app/pages/product.vue +++ b/apps/admin/app/pages/product.vue @@ -216,6 +216,9 @@
+ @@ -370,6 +373,12 @@
+
+ + +