feat(web): 京东工具台三页头部加密钥设置入口(2026-11-22 用户口径「这边也要加密钥设置」,京东上架 AI 补值要读登录用户 LLM 密钥)

- BrandApiSecretSettingsButton 加可选 showProxy(默认 true,亚马逊侧现有调用零变化);透传面板既有 showProxy(708/771 行已按它条件保存/余额);副标题按 showProxy 派生(隐藏代理时不再提「代理设置保存在当前客户端」)
- JdConsolePage/JdCollectTab/JdPublishTab 头部 .top-right(铃铛与用户名之间)各插 <BrandApiSecretSettingsButton variant="topbar" :show-proxy="false"/>——京东特性无代理消费方,隐藏代理区防「没配代理影响京东采集吗」误判(铁律 27 同款)
- 弹窗/保存/检测/余额走既有 /newApi/api/user-secrets 链,零新端点零新权限 key
- 判据:jd-secret-entry.test.ts(三页头部精确匹配+按钮四钉)+jd-secret-entry.mount.test.ts(top-right 触发钮/showProxy 透传/副标题三用例);四支既有 JD mount 补 ApiSecretSettingsPanel stub 防真发 fetch(31 绿+mount 59 绿零噪声+vue-tsc rc=0)

随下一 app-web 窗上线
This commit is contained in:
2026-11-22 21:51:45 +08:00
parent 988cc633a0
commit 6a52e24eb9
10 changed files with 189 additions and 4 deletions
@@ -17,11 +17,11 @@
<template #header>
<div class="dialog-header">
<div class="dialog-title">密钥设置</div>
<div class="dialog-subtitle">密钥保存在服务端并绑定当前账号,换设备登录后自动同步;代理设置保存在当前客户端。</div>
<div class="dialog-subtitle">{{ dialogSubtitle }}</div>
</div>
</template>
<ApiSecretSettingsPanel ref="panelRef" />
<ApiSecretSettingsPanel ref="panelRef" :show-proxy="showProxy" />
<template #footer>
<div class="dialog-footer">
@@ -48,19 +48,33 @@
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
import { computed, ref, watch } from 'vue'
import ApiSecretSettingsPanel from '@/shared/components/ApiSecretSettingsPanel.vue'
withDefaults(
const props = withDefaults(
defineProps<{
/** topbar=顶栏纯文字样式(对齐主程序);默认=现有胶囊按钮 */
variant?: 'topbar'
/**
* 是否展示代理设置区(透传给面板,默认展示)。京东工具台入口传 false——
* 京东特性(采集=本机浏览器、上架补值=LLM 密钥)没有任何代理消费方,
* 展示青果/jikip 配置只会引来「没配代理影响京东采集吗」的误判。
*/
showProxy?: boolean
}>(),
{
variant: undefined,
showProxy: true,
},
)
/** 副标题跟着代理区走:隐藏代理时不再提「代理设置保存在当前客户端」。 */
const dialogSubtitle = computed(() =>
props.showProxy
? '密钥保存在服务端并绑定当前账号,换设备登录后自动同步;代理设置保存在当前客户端。'
: '密钥保存在服务端并绑定当前账号,换设备登录后自动同步。',
)
const dialogVisible = ref(false)
const saving = ref(false)
const panelRef = ref<InstanceType<typeof ApiSecretSettingsPanel> | null>(null)
@@ -22,6 +22,7 @@ import { userNotice } from '@/shared/utils/user-notice'
import { formatDateTime } from '@/shared/utils/datetime'
import { useLiveTaskBoard } from '@/shared/composables/useLiveTaskBoard'
import NotificationBell from '@/shared/components/NotificationBell.vue'
import BrandApiSecretSettingsButton from '@/pages/brand/components/BrandApiSecretSettingsButton.vue'
/** 京东「获取店铺数据」(v1.5):一键建单 → 推送本机客户端 → 右侧任务面板实时进度。
*
@@ -664,6 +665,7 @@ onUnmounted(() => {
<div class="top-right">
<NotificationBell />
<BrandApiSecretSettingsButton variant="topbar" :show-proxy="false" />
<span class="admin-name">{{ username }}</span>
</div>
</header>
@@ -13,6 +13,7 @@
<div class="top-right">
<NotificationBell />
<BrandApiSecretSettingsButton variant="topbar" :show-proxy="false" />
<span class="admin-name">{{ username }}</span>
</div>
</header>
@@ -88,6 +89,7 @@
import { onBeforeUnmount, onMounted, ref } from 'vue'
import NotificationBell from '@/shared/components/NotificationBell.vue'
import BrandApiSecretSettingsButton from '@/pages/brand/components/BrandApiSecretSettingsButton.vue'
import { resolvePageHref } from '@/shared/page-prefix'
import { getCurrentUserAppColumnKeys } from '@/shared/api/permission'
import { filterJdToolsByPermission, JD_TOOLS, type JdToolInfo } from '@/pages/jd/tool-catalog'
@@ -26,6 +26,7 @@ import { userNotice } from '@/shared/utils/user-notice'
import { formatDateTime } from '@/shared/utils/datetime'
import { useLiveTaskBoard } from '@/shared/composables/useLiveTaskBoard'
import NotificationBell from '@/shared/components/NotificationBell.vue'
import BrandApiSecretSettingsButton from '@/pages/brand/components/BrandApiSecretSettingsButton.vue'
/** 京东「商品上架」(v1.5 蓝图 §4 Phase 4):选分类 → 勾商品 → 改价规则 → 建单 → 右侧任务面板实时行级进度。
*
@@ -613,6 +614,7 @@ onUnmounted(() => {
</div>
<div class="top-right">
<NotificationBell />
<BrandApiSecretSettingsButton variant="topbar" :show-proxy="false" />
<span class="admin-name">{{ username }}</span>
</div>
</header>