mirror of
https://github.com/qitoqito/psyduck.git
synced 2026-01-11 20:20:43 +08:00
Update qlCreate.js
This commit is contained in:
parent
7579c13d31
commit
3a639b51f9
@ -6,6 +6,7 @@ import {
|
||||
import ini from 'ini'
|
||||
import axios from "axios";
|
||||
import {decryptFile} from "./fileCrypto.js";
|
||||
|
||||
class Ql {
|
||||
constructor() {
|
||||
console.log(`Readme: 请先初始化config.ini,打开qitoqito_psyduck/config文件夹,将demo.ini重命名为config.ini\n 设置QINGLONG_ClientId和QINGLONG_ClientSecret(前面;符号要去掉才能正常解析)\n 如需使用脚本分身,请先自行创建分类ini\n 以京东为例,在指定的iniPath目录(默认qitoqito_psyduck/config)自行创建jd.ini\n\n [jd_checkCookie]\n map=jd_task_checkCookie\n ;title=自定义脚本名\n ;crontab=自定义定时(6 6 6 6 6)\n\n 将上述节点代码复制到jd.ini,jd_checkCookie就能映射到jd_task_checkCookie脚本\n`)
|
||||
@ -225,7 +226,7 @@ class Ql {
|
||||
let dicts = {}
|
||||
let dir = fs.readdirSync(`${abspath}/parse`);
|
||||
let panelJson = this.panelJson
|
||||
let fileList=[]
|
||||
let fileList = []
|
||||
dir.forEach(async function(item, index) {
|
||||
let config = panelJson.script[item] || {}
|
||||
let delList = config.delete || []
|
||||
@ -239,8 +240,8 @@ class Ql {
|
||||
}
|
||||
}.bind(this))
|
||||
await this.wait(1000)
|
||||
for(let filePath of fileList){
|
||||
await decryptFile(filePath,filePath)
|
||||
for (let filePath of fileList) {
|
||||
await decryptFile(filePath, filePath)
|
||||
}
|
||||
dir.forEach(async function(item, index) {
|
||||
let config = panelJson.script[item] || {}
|
||||
@ -256,6 +257,7 @@ class Ql {
|
||||
try {
|
||||
let imp = await import (`${abspath}/parse/${item}/${map}.js`)
|
||||
let psyDuck = new imp.Main()
|
||||
psyDuck.env.delayTo = this.env.delayTo || null
|
||||
let crontab = obj[filename].crontab || psyDuck.crontab()
|
||||
let title = obj[filename].title || `${psyDuck.profile.title}分身`
|
||||
let code = `
|
||||
@ -333,6 +335,7 @@ import {fileURLToPath, pathToFileURL} from 'url';
|
||||
let imp = await
|
||||
import (`${abspath}/parse/${item}/${script}`)
|
||||
let psyDuck = new imp.Main()
|
||||
psyDuck.env.delayTo = this.env.delayTo || null
|
||||
let crontab = psyDuck.crontab()
|
||||
let code = `
|
||||
import path from 'path';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user