904118851 8 months ago
parent
commit
76c9e863f3
2 changed files with 6 additions and 11 deletions
  1. 1 1
      PULL_DATA_FACTORY/PULL_DATA.js
  2. 5 10
      PULL_DATA_FACTORY/daily_records.js

+ 1 - 1
PULL_DATA_FACTORY/PULL_DATA.js

@@ -391,7 +391,7 @@ CMD.init = async function(){
         },
         {
           name: '下午区间',
-          start: '17:08',
+          start: '17:12',
           timestamp: 1733821200000,
           hour: 17,
           timeFormat: '12/10/2024, 5:00:00 PM'

+ 5 - 10
PULL_DATA_FACTORY/daily_records.js

@@ -65,21 +65,16 @@ class DailyRecordManager {
                     return null;
                 }
     
-                // 添加内容检查
                 const record = rows[0];
-                let parsedContent = {};
                 
-                if (record.content) {
-                    try {
-                        parsedContent = JSON.parse(record.content);
-                    } catch (jsonError) {
-                        console.warn('JSON解析失败,使用默认空对象:', jsonError);
-                    }
-                }
+                // 检查 content 的类型
+                const content = typeof record.content === 'string' 
+                    ? JSON.parse(record.content)  // 如果是字符串,则解析
+                    : record.content;             // 如果已经是对象,直接使用
     
                 return {
                     ...record,
-                    content: parsedContent
+                    content
                 };
                 
             } finally {