fix(appearance-patent): 代理缺失回填与任务前置提示
- 本地代理回填兼容旧版全局 proxy_url,补报成功后重拉服务端快照 - 创建任务前检查服务端代理,缺失时弹窗拦截并引导配置 - 商标查询失败的真实原因写入结果原因列,不再只显示查询失败
This commit is contained in:
@@ -73,7 +73,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||
import { userNotice } from '@/shared/utils/user-notice'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import AmazonToolPageShell from '@/pages/amazon/components/AmazonToolPageShell.vue';
|
||||
import FileUploadZone from '@/shared/components/FileUploadZone.vue'
|
||||
import ModuleTemplateDownload from '@/shared/components/ModuleTemplateDownload.vue'
|
||||
@@ -105,7 +105,7 @@ import { checkParseResult } from '@/shared/dispatch-guard'
|
||||
import { passGuard } from '@/shared/dispatch-guard-ui'
|
||||
import { formatDateTime } from '@/shared/utils/datetime'
|
||||
import { resultBuildFailed, taskStatusClass, taskStatusText } from '@/shared/utils/task-status-text'
|
||||
import { getStoredApiSecret } from '@/shared/utils/api-secret-store'
|
||||
import { ensureBrandCheckProxy, getStoredApiSecret } from '@/shared/utils/api-secret-store'
|
||||
|
||||
// ---- 文件选择 / 上传(公共组合式函数)----
|
||||
const {
|
||||
@@ -392,6 +392,26 @@ function toTaskSummary(result: AppearancePatentParseVo): TaskSummary {
|
||||
* 逐行抓取用例钉住:maixiang_run_task/test/maixiang_ops/test_proxy_cost_leaks.py。
|
||||
*/
|
||||
|
||||
/**
|
||||
* 创建任务前确认服务端有代理:商标维度依赖服务端代理,缺代理时整批都会落成
|
||||
* 「商标查询失败」且状态为失败。服务端读不到(unknown)不拦,避免网络抖动误伤。
|
||||
*/
|
||||
async function ensureBrandCheckProxyReady(): Promise<boolean> {
|
||||
const check = await ensureBrandCheckProxy()
|
||||
if (check.ok) return true
|
||||
await ElMessageBox.alert(
|
||||
'当前账号未在服务端配置代理,商标维度将无法查询,整批结果会显示「商标查询失败」。'
|
||||
+ '请先点击右上角「密钥设置」,在「代理地址」中保存代理后再创建任务。',
|
||||
'未配置代理,无法检测商标',
|
||||
{ type: 'warning', confirmButtonText: '知道了' },
|
||||
).then(
|
||||
// 关闭弹窗会以 reject 收尾,属正常交互而不是错误,不新增 catch 块
|
||||
() => undefined,
|
||||
() => undefined,
|
||||
)
|
||||
return false
|
||||
}
|
||||
|
||||
async function parseFiles() {
|
||||
if (!uploadedFiles.value.length) {
|
||||
ElMessage.warning('请先选择 Excel')
|
||||
@@ -403,6 +423,9 @@ async function parseFiles() {
|
||||
}
|
||||
parsing.value = true
|
||||
try {
|
||||
if (!(await ensureBrandCheckProxyReady())) {
|
||||
return
|
||||
}
|
||||
const files: UploadedFileRef[] = uploadedFiles.value.map((f) => ({
|
||||
fileKey: f.fileKey,
|
||||
originalFilename: f.originalFilename,
|
||||
|
||||
Reference in New Issue
Block a user