|
|
@@ -1,12 +1,22 @@
|
|
|
const puppeteer = require('puppeteer');
|
|
|
const fs = require('fs');
|
|
|
-
|
|
|
-
|
|
|
-//need: reply_info, sign
|
|
|
-//from url: https://testmis.ssti.net.cn/xswxcs/?reply_info=******&sign=******
|
|
|
-const info = [
|
|
|
- ['reply_info', 'sign']
|
|
|
-];
|
|
|
+let info;
|
|
|
+try {
|
|
|
+ info = require('./config')();
|
|
|
+} catch (e) {
|
|
|
+ try {
|
|
|
+ info = require('./config.example')();
|
|
|
+ } catch (e) {
|
|
|
+ console.log("配置文件错误");
|
|
|
+ process.exit();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+}
|
|
|
+if (!info || !info[0] || !info[0][0] || !info[0][1] || info[0][0] === 'reply_info' || info[0][1] === 'sign') {
|
|
|
+ console.log("配置文件错误");
|
|
|
+ process.exit();
|
|
|
+ return;
|
|
|
+}
|
|
|
|
|
|
let infoOK = [];
|
|
|
|
|
|
@@ -133,7 +143,6 @@ async function run(browser, replyInfo, sign) {
|
|
|
await page.close();
|
|
|
reject("Unknown URL: " + response.url());
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
try {
|
|
|
await page.click("#Apply_Epidemic");
|