Browse Source

增加用户默认头像

Pchen. 3 months ago
parent
commit
874108608f
1 changed files with 3 additions and 2 deletions
  1. 3 2
      apis/Lepao/Account/AddAccount.js

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

@@ -103,8 +103,9 @@ class AddAccount extends API {
                 r = await db.query(sql, [uuid, email, area, auto_time, auto_run, target_count, time, notes ?? '', userInfo.frequency, countRows[0].id])
             }
             else {
-                sql = 'INSERT INTO lepao_account (student_num, name, grade_id, uid, sex, total_num, email, area, auto_time, auto_run, target_count, create_user, create_time, notes, password) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'
-                r = await db.query(sql, [student_num, userInfo.nickName, userInfo.department, userInfo.id, userInfo.sex, userInfo.frequency, email, area, auto_time, auto_run, target_count, uuid, time, notes ?? '', password])
+                const user_avatar = userInfo.sex === 0 ? 'https://lepao-cloud.xxoo365.top/view.php/aee85ff43fd30d0df03c6a7dd9797d22.png' : 'https://lepao-cloud.xxoo365.top/view.php/fcb54dcc5e6209381e972ef73bdb4a93.png'
+                sql = 'INSERT INTO lepao_account (student_num, name, user_avatar,  grade_id, uid, sex, total_num, email, area, auto_time, auto_run, target_count, create_user, create_time, notes, password) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'
+                r = await db.query(sql, [student_num, userInfo.nickName, user_avatar, userInfo.department, userInfo.id, userInfo.sex, userInfo.frequency, email, area, auto_time, auto_run, target_count, uuid, time, notes ?? '', password])
             }
         } else {
             sql = 'UPDATE lepao_account SET student_num = ?, email = ?, area = ?, auto_time = ?, target_count = ?, auto_run = ?, notes = ? WHERE id = ?'