Browse Source

优化乐跑功能

Pchen. 11 months ago
parent
commit
c500cd5ead
3 changed files with 5 additions and 6 deletions
  1. 2 1
      apis/Lepao/UpdateAccount.js
  2. 1 1
      lib/Lepao/Lepao.js
  3. 2 4
      plugin/Email/emailTemplate.js

+ 2 - 1
apis/Lepao/UpdateAccount.js

@@ -53,7 +53,7 @@ class UpdateAccount extends API {
                     msg: '未提取出用户登录信息,请重试'
                 })
 
-            let findSql = 'SELECT email, create_user FROM lepao_account WHERE student_num = ?'
+            let findSql = 'SELECT email, create_user, auto_run FROM lepao_account WHERE student_num = ?'
             let findRows = await db.query(findSql, [student_num])
             if (!findRows)
                 return res.json({
@@ -77,6 +77,7 @@ class UpdateAccount extends API {
                         sex,
                         academy_name,
                         grade_id,
+                        auto_run: findRows[0].auto_run,
                         account: student_num
                     }
                 })

+ 1 - 1
lib/Lepao/Lepao.js

@@ -23,7 +23,7 @@ class Lepao {
         const min = Number(min_distance) || 1.60
 
         if (vip !== 1) {
-            if (area) throw new Error('指定乐跑区为 VIP 专用功能,请先开通 VIP')
+            if (area) throw new Error('指定乐跑区为 VIP 专用功能,请先开通 VIP')
             if (max !== 4.00 || min !== 1.60) {
                 throw new Error('指定乐跑距离区间为 VIP 专用功能,请先开通 VIP')
             }

+ 2 - 4
plugin/Email/emailTemplate.js

@@ -340,6 +340,8 @@ class emailTemplate {
                     <div class="info">
                         <p><strong>学号:</strong> ${data.account}</p>
                         <p><strong>跑区:</strong> ${data.pass_tit}</p>
+                        <p><strong>跑步时间:</strong> ${this.formatSecondsToMinSec(data.time)}</p>
+                        <p><strong>平均配速:</strong> ${this.calculatePace(data.time, data.distance)}</p>
                         <p><strong>跑步距离:</strong> ${data.distance} Km</p>
                         
                     </div>
@@ -354,10 +356,6 @@ class emailTemplate {
         )
     }
 
-    // <p><strong>跑步时长:</strong> ${this.formatSecondsToMinSec(data.time)} Km</p>
-    //                     <p><strong>平均配速:</strong> ${this.calculatePace(data.time, data.distance)}</p>
-    //                     <p><strong>乐跑时间:</strong> ${this.stramptoTime(time)}</p>
-
     async lepaoFail(email, data) {
         const time = new Date().getTime()
         await sendEmail(email, 'RunForge - 乐跑失败提醒',