Browse Source

🐞 fix: 修改错误的变量名

Pchen. 2 months ago
parent
commit
dff26c91d6
1 changed files with 5 additions and 1 deletions
  1. 5 1
      apis/AI/SummaryFile.js

+ 5 - 1
apis/AI/SummaryFile.js

@@ -44,7 +44,7 @@ class SummaryFile extends API {
 
         try {
             const time = new Date().getTime()
-            filePath = path.join(r[0].path, filePath)
+            filePath = path.join(rows[0].path, filePath)
             sql = 'INSERT INTO file_summary_tasks (repo_id, create_time, create_user, repo_hash, filepath) VALUES (?, ?, ?, ?, ?)'
             let r = await db.query(sql, [id, time, uuid, hash, filePath])
 
@@ -62,6 +62,10 @@ class SummaryFile extends API {
             await axios.post(endpoint, { uuid, repo_url: rows[0].url, task_id: String(r.insertId), file_path: filePath })
         } catch (error) {
             this.logger.error('添加AI分析任务失败!' + error.stack)
+            return res.json({
+                ...BaseStdResponse.ERR,
+                msg: '添加AI分析任务失败!'
+            })
         }
     }
 }