|
@@ -47,19 +47,26 @@ class UpdateStateAll extends API {
|
|
|
this.logger.info(`${student_num}更新乐跑登录状态返回结果: ${JSON.stringify(data)}`)
|
|
this.logger.info(`${student_num}更新乐跑登录状态返回结果: ${JSON.stringify(data)}`)
|
|
|
|
|
|
|
|
if (!data || data.status != 1 || !data.data) {
|
|
if (!data || data.status != 1 || !data.data) {
|
|
|
- this.logger.info(`${name}(${student_num})数据获取失败,不更新`)
|
|
|
|
|
|
|
+ if (data?.info.includes('重新登录')) {
|
|
|
|
|
+ const sql = 'UPDATE lepao_account SET state = 0 WHERE student_num = ?'
|
|
|
|
|
+ await db.query(sql, [student_num])
|
|
|
|
|
+ this.logger.info(`${name}(${student_num})状态更新为待登录`)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ else this.logger.info(`${name}(${student_num})数据获取失败`)
|
|
|
|
|
+
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const sql = 'UPDATE lepao_account SET state = 1 WHERE student_num = ?'
|
|
const sql = 'UPDATE lepao_account SET state = 1 WHERE student_num = ?'
|
|
|
await db.query(sql, [student_num])
|
|
await db.query(sql, [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}`)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.logger.info('更新乐跑账号登录状态完成')
|
|
this.logger.info('更新乐跑账号登录状态完成')
|