()
| 344 | } |
| 345 | |
| 346 | function requireConfig() { |
| 347 | return new Promise(resolve => { |
| 348 | if ($.isNode() && process.env.UN_SUBSCRIBES) { |
| 349 | if (process.env.UN_SUBSCRIBES.indexOf('&') > -1) { |
| 350 | $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split('&'); |
| 351 | } else if (process.env.UN_SUBSCRIBES.indexOf('\n') > -1) { |
| 352 | $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split('\n'); |
| 353 | } else if (process.env.UN_SUBSCRIBES.indexOf('\\n') > -1) { |
| 354 | $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split('\\n'); |
| 355 | } else { |
| 356 | $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split(); |
| 357 | } |
| 358 | console.log(`您环境变量 UN_SUBSCRIBES 设置的内容为:\n${JSON.stringify($.UN_SUBSCRIBES)}`) |
| 359 | goodPageSize = $.UN_SUBSCRIBES[0] || goodPageSize; |
| 360 | shopPageSize = $.UN_SUBSCRIBES[1] || shopPageSize; |
| 361 | stopGoods = $.UN_SUBSCRIBES[2] || stopGoods; |
| 362 | stopShop = $.UN_SUBSCRIBES[3] || stopShop; |
| 363 | } |
| 364 | resolve() |
| 365 | }) |
| 366 | } |
| 367 | |
| 368 | function jsonParse(str) { |
| 369 | if (typeof str == "string") { |
no test coverage detected