|
@@ -1,7 +1,7 @@
|
|
|
const API = require("../../lib/API");
|
|
const API = require("../../lib/API");
|
|
|
const db = require('../../plugin/DataBase/db')
|
|
const db = require('../../plugin/DataBase/db')
|
|
|
const Redis = require('../../plugin/DataBase/Redis')
|
|
const Redis = require('../../plugin/DataBase/Redis')
|
|
|
-const lepao = require("../../lib/Lepao/Lepao.js").lepao
|
|
|
|
|
|
|
+const lepao = require("../../lib/Lepao/cg_lepao.js").Lepao
|
|
|
|
|
|
|
|
const { BaseStdResponse } = require("../../BaseStdResponse");
|
|
const { BaseStdResponse } = require("../../BaseStdResponse");
|
|
|
|
|
|
|
@@ -23,7 +23,7 @@ class StartAutoLepao extends API {
|
|
|
const hour = new Date().getHours()
|
|
const hour = new Date().getHours()
|
|
|
this.logger.info('开始执行自动乐跑任务')
|
|
this.logger.info('开始执行自动乐跑任务')
|
|
|
let sql = `
|
|
let sql = `
|
|
|
- SELECT name, create_user, student_num, token, uid, school_id, state
|
|
|
|
|
|
|
+ SELECT name, create_user, student_num
|
|
|
FROM lepao_account
|
|
FROM lepao_account
|
|
|
WHERE auto_run = 1
|
|
WHERE auto_run = 1
|
|
|
AND (auto_time = ? OR (auto_time = -1 AND today_auto_time = ?))
|
|
AND (auto_time = ? OR (auto_time = -1 AND today_auto_time = ?))
|
|
@@ -33,17 +33,17 @@ class StartAutoLepao extends API {
|
|
|
return this.logger.error('获取自动乐跑账号失败!')
|
|
return this.logger.error('获取自动乐跑账号失败!')
|
|
|
|
|
|
|
|
for (const item of r) {
|
|
for (const item of r) {
|
|
|
- const { name, create_user, student_num, token, uid, school_id, state } = item
|
|
|
|
|
|
|
+ const { name, create_user, student_num } = item
|
|
|
this.logger.info(`${name}(${student_num})开始乐跑`)
|
|
this.logger.info(`${name}(${student_num})开始乐跑`)
|
|
|
|
|
|
|
|
- const isSuccess = await Redis.get(`lepaoSuccess:${student_num}`)
|
|
|
|
|
|
|
+ const isSuccess = await Redis.get(`cgLepaoSuccess:${student_num}`)
|
|
|
if (isSuccess) {
|
|
if (isSuccess) {
|
|
|
this.logger.info(`${name}(${student_num})当天已乐跑成功,不执行自动乐跑`)
|
|
this.logger.info(`${name}(${student_num})当天已乐跑成功,不执行自动乐跑`)
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- await lepao.beginLepao(create_user, student_num, token, uid, school_id, state)
|
|
|
|
|
|
|
+ await lepao.beginLepao(create_user, student_num)
|
|
|
this.logger.info(`${name}(${student_num})乐跑完成`)
|
|
this.logger.info(`${name}(${student_num})乐跑完成`)
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
this.logger.error(`${name}(${student_num})乐跑失败:${err.message || err}`)
|
|
this.logger.error(`${name}(${student_num})乐跑失败:${err.message || err}`)
|