mirror of
https://github.com/qitoqito/psyduck.git
synced 2026-01-12 21:20:43 +08:00
支持旧版bug龙订阅
This commit is contained in:
parent
24f1cb20f1
commit
e091c3af2d
14
qlCreate.js
14
qlCreate.js
@ -191,7 +191,9 @@ class Ql {
|
|||||||
let iniPath = this.env.iniPath || `${abspath}/config`
|
let iniPath = this.env.iniPath || `${abspath}/config`
|
||||||
let crons = await this.getCrons()
|
let crons = await this.getCrons()
|
||||||
let data = {}
|
let data = {}
|
||||||
for (let i of crons.data) {
|
let cronData = crons.data || crons
|
||||||
|
let label = crons.data ? true : false
|
||||||
|
for (let i of cronData) {
|
||||||
let command = i.command.match(/task\s*qitoqito_psyduck\/(\w+\.js)/)
|
let command = i.command.match(/task\s*qitoqito_psyduck\/(\w+\.js)/)
|
||||||
if (command) {
|
if (command) {
|
||||||
let script = command[1]
|
let script = command[1]
|
||||||
@ -266,7 +268,10 @@ import {fileURLToPath, pathToFileURL} from 'url';
|
|||||||
name: `PsyDuck_${title}`,
|
name: `PsyDuck_${title}`,
|
||||||
schedule: crontab,
|
schedule: crontab,
|
||||||
command: `task qitoqito_psyduck/${filename}.js`,
|
command: `task qitoqito_psyduck/${filename}.js`,
|
||||||
labels: [`PsyDuck`]
|
// labels: label ? [`PsyDuck`] : ''
|
||||||
|
}
|
||||||
|
if (label) {
|
||||||
|
dicts[`${filename}.js`].labels = [`PsyDuck`]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -328,7 +333,10 @@ import {fileURLToPath, pathToFileURL} from 'url';
|
|||||||
name: `PsyDuck_${psyDuck.profile.title}`,
|
name: `PsyDuck_${psyDuck.profile.title}`,
|
||||||
schedule: crontab,
|
schedule: crontab,
|
||||||
command: `task qitoqito_psyduck/${script}`,
|
command: `task qitoqito_psyduck/${script}`,
|
||||||
labels: [`PsyDuck`]
|
// labels: label ? [`PsyDuck`] : ''
|
||||||
|
}
|
||||||
|
if (label) {
|
||||||
|
dicts[script].labels = [`PsyDuck`]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export class Panel {
|
|||||||
|
|
||||||
async _qlTask() {
|
async _qlTask() {
|
||||||
let envs = await this.getEnvs(`${this.type}_cookie`.toUpperCase())
|
let envs = await this.getEnvs(`${this.type}_cookie`.toUpperCase())
|
||||||
if (envs.length) {
|
if (envs.length>0) {
|
||||||
for (let i of envs) {
|
for (let i of envs) {
|
||||||
let pin = this.func.userName(i.value)
|
let pin = this.func.userName(i.value)
|
||||||
if (this.dict[pin]) {
|
if (this.dict[pin]) {
|
||||||
@ -62,12 +62,10 @@ export class Panel {
|
|||||||
value: this.dict[i].cookie
|
value: this.dict[i].cookie
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (array.length) {
|
if (array.length>0) {
|
||||||
let data = await this.addEnvs(array)
|
let data = await this.addEnvs(array)
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
for (let pin in this.dict) {
|
this.func.msg(`新增: ${i} 成功`)
|
||||||
this.func.msg(`新增: ${pin} 成功`)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.error('[Error] 添加账号失败');
|
console.error('[Error] 添加账号失败');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user