Browse Source

🐞 fix: 修复无法添加账户的问题

Pchen. 8 months ago
parent
commit
548dc1d484
1 changed files with 2 additions and 2 deletions
  1. 2 2
      apis/Lepao/Account/AddAccount.js

+ 2 - 2
apis/Lepao/Account/AddAccount.js

@@ -77,10 +77,10 @@ class AddAccount extends API {
 
         if (!id) {
             sql = 'INSERT INTO lepao_account (student_num, email, area, auto_time, create_user, create_time, notes) VALUES (?, ?, ?, ?, ?, ?, ?)'
-            r = await db.query(sql, [student_num, email, area, auto_time, uuid, time, notes])
+            r = await db.query(sql, [student_num, email, area, auto_time, uuid, time, notes ?? ''])
         } else {
             sql = 'UPDATE lepao_account SET student_num = ?, email = ?, area = ?, auto_time = ?, update_time = ?, notes = ? WHERE id = ?'
-            r = await db.query(sql, [student_num, email, area, auto_time, time, notes, id])
+            r = await db.query(sql, [student_num, email, area, auto_time, time, notes ?? '', id])
         }
 
         try {