diff --git a/frontend/src/features/chat/composables/useChatAssetImage.ts b/frontend/src/features/chat/composables/useChatAssetImage.ts index b75f5767..53da1537 100644 --- a/frontend/src/features/chat/composables/useChatAssetImage.ts +++ b/frontend/src/features/chat/composables/useChatAssetImage.ts @@ -27,12 +27,16 @@ function normalizeAssetImageErrorMessage(message: string): string { if (lowerCaseMessage.includes('固定资产图片文档库未配置')) { return '当前系统暂未配置固定资产图片文档库,暂时无法查看图片,请联系管理员处理。'; } + if (lowerCaseMessage.includes('请求的资源不存在')) { + return '设备管理员还未上传照片~'; + } if (lowerCaseMessage.includes('未找到资产')) { return normalizedMessage; } return normalizedMessage || '检索固定资产图片失败'; } + export function useChatAssetImage(options: UseChatAssetImageOptions) { const loading = ref(false); @@ -76,7 +80,11 @@ export function useChatAssetImage(options: UseChatAssetImageOptions) { } catch (err: unknown) { const rawMessage = err instanceof Error ? err.message : '检索固定资产图片失败'; const message = normalizeAssetImageErrorMessage(rawMessage); - options.warn(`图片查询失败:${message}`); + if (message === '设备管理员还未上传照片~') { + options.warn(message); + } else { + options.warn(`图片查询失败:${message}`); + } } finally { loading.value = false; }