ソースを参照

fix(deviceStatus): 修复错误日志消息判断逻辑

- 添加对全角叹号 ! 的支持
- 更新错误日志判断条件以匹配半角或全角叹号
- 修正注释描述以反映新的判断规则
panqiuyao 3 週間 前
親
コミット
1e02f72eee
1 ファイル変更、3 行追加、2 行削除
  1. 3 2
      frontend/src/stores/modules/deviceStatus.ts

+ 3 - 2
frontend/src/stores/modules/deviceStatus.ts

@@ -5,7 +5,8 @@ import icpList from '@/utils/ipc';
 import socket from "@/stores/modules/socket";
 
 export function isErrorLogMessage(message?: string) {
-  return String(message || '').trimStart().startsWith('!');
+  const text = String(message || '').trimStart();
+  return text.startsWith('!') || text.startsWith('!');
 }
 
 export interface McuErrorLog {
@@ -32,7 +33,7 @@ const useDeviceStatusStore = defineStore('deviceStatus', () => {
   // 未读数量(全部日志)
   const unreadCount = ref(0);
 
-  // 以 ! 开头的未读报错数量(用于顶部设备状态气泡)
+  // 以半角 ! 或全角 ! 开头的未读报错数量(用于顶部设备状态气泡)
   const errorUnreadCount = ref(0);
 
   // 弹窗是否显示