hongrunhui / node_12306

史上最“脑残”的“抢火车票”程序(node.js版)
239 stars 67 forks source link

关于fs.writeFile 写入报错问题解决 #33

Open JslinSir opened 4 years ago

JslinSir commented 4 years ago

image

添加回调

JslinSir commented 4 years ago

fs.writeFile('config.json', JSON.stringify(config),function(){ var rule = new schedule.RecurrenceRule(); rule.second = [0]; getLeftTicketUrl((data) => { config.leftTicketUrl = data.leftTicketUrl; queryTickets(config); schedule.scheduleJob(rule, function () { queryTickets(config); }); }); });