1
0
mirror of https://github.com/6dylan6/jdpro.git synced 2026-04-16 03:42:48 +08:00

Compare commits

...

15 Commits

Author SHA1 Message Date
Tangcong
43909ff996 Merge 005fe03104 into b09f0de143 2025-01-12 01:35:33 +08:00
2024
b09f0de143 1 2025-01-11 23:52:32 +08:00
2024
0da473a08c 1 2025-01-11 23:02:35 +08:00
2024
3e4cfce4bd 1 2025-01-11 22:48:54 +08:00
2024
f71a15a657 1 2025-01-11 21:07:06 +08:00
2024
6ad4dce833 1 2025-01-11 20:28:58 +08:00
2024
b048de83b8 1 2025-01-11 18:14:43 +08:00
2024
01610e0ae1 1 2025-01-11 18:01:17 +08:00
2024
20e6026473 1 2025-01-11 17:55:19 +08:00
2024
b610cc2646 1 2025-01-11 16:34:32 +08:00
2024
2009c0dbb1 1 2025-01-11 12:53:55 +08:00
2024
87db7cb8db 1 2025-01-11 12:50:01 +08:00
2024
d89e8d7712 1 2025-01-11 10:39:20 +08:00
2024
bc8b84a1b8 1 2025-01-10 23:52:26 +08:00
Tangcong
005fe03104 提交测试
点击右上角绿色按钮 "Commit changes..."。对于提交,您可以输入简短文字来描述您所做的更改。 此信息可帮助其他人了解您的提交中包含的内容。 GitHub 提供了一个简单的默认描述,但让我们稍微更改一下以进行练习。 首先,在第一个标题为“提交消息”的文本输入字段中输入 Add PROFILE.md。
2024-10-22 10:34:12 +08:00
12 changed files with 177 additions and 145 deletions

1
PROFILE.md Normal file
View File

@@ -0,0 +1 @@
Welcome to my GitHub profile!

File diff suppressed because one or more lines are too long

View File

@@ -4,147 +4,149 @@ const got = require('got');
require('dotenv').config();
const { readFile } = require('fs/promises');
const path = require('path');
const qlDir = '/ql';
const fs = require('fs');
let Fileexists280 = fs.existsSync('/ql/data/db/keyv.sqlite');
let Fileexists = fs.existsSync('/ql/data/config/auth.json');
let authFile="";
if (Fileexists)
authFile="/ql/data/config/auth.json"
let authFile = "";
if (Fileexists280)
authFile = "/ql/data/db/keyv.sqlite"
else if (Fileexists)
authFile = "/ql/data/config/auth.json"
else
authFile="/ql/config/auth.json"
//const authFile = path.join(qlDir, 'config/auth.json');
authFile = "/ql/config/auth.json"
const api = got.extend({
prefixUrl: 'http://127.0.0.1:5600',
retry: { limit: 0 },
prefixUrl: 'http://127.0.0.1:5600',
retry: { limit: 0 },
});
async function getToken() {
const authConfig = JSON.parse(await readFile(authFile));
return authConfig.token;
const authConfig = await readFile(authFile);
// console.log(authConfig.toString().match(/"token":"(.*?)",/)[1])
return authConfig.toString().match(/"token":"(.*?)",/)[1];
}
module.exports.getEnvs = async () => {
const token = await getToken();
const body = await api({
url: 'api/envs',
searchParams: {
searchValue: 'JD_COOKIE',
t: Date.now(),
},
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
},
}).json();
return body.data;
// getToken()
module.exports.getEnvs = async () => {
const token = await getToken();
const body = await api({
url: 'api/envs',
searchParams: {
searchValue: 'JD_COOKIE',
t: Date.now(),
},
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
},
}).json();
return body.data;
};
module.exports.getEnvsCount = async () => {
const data = await this.getEnvs();
return data.length;
const data = await this.getEnvs();
return data.length;
};
module.exports.addEnv = async (cookie, remarks) => {
const token = await getToken();
const body = await api({
method: 'post',
url: 'api/envs',
params: { t: Date.now() },
json: [{
name: 'JD_COOKIE',
value: cookie,
remarks,
}],
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
const token = await getToken();
const body = await api({
method: 'post',
url: 'api/envs',
params: { t: Date.now() },
json: [{
name: 'JD_COOKIE',
value: cookie,
remarks,
}],
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
};
module.exports.updateEnv = async (cookie, eid, remarks) => {
const token = await getToken();
const body = await api({
method: 'put',
url: 'api/envs',
params: { t: Date.now() },
json: {
name: 'JD_COOKIE',
value: cookie,
_id: eid,
remarks,
},
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
const token = await getToken();
const body = await api({
method: 'put',
url: 'api/envs',
params: { t: Date.now() },
json: {
name: 'JD_COOKIE',
value: cookie,
_id: eid,
remarks,
},
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
};
module.exports.updateEnv11 = async (cookie, eid, remarks) => {
const token = await getToken();
const body = await api({
method: 'put',
url: 'api/envs',
params: { t: Date.now() },
json: {
name: 'JD_COOKIE',
value: cookie,
id: eid,
remarks,
},
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
const token = await getToken();
const body = await api({
method: 'put',
url: 'api/envs',
params: { t: Date.now() },
json: {
name: 'JD_COOKIE',
value: cookie,
id: eid,
remarks,
},
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
};
module.exports.DisableCk = async (eid) => {
const token = await getToken();
const body = await api({
method: 'put',
url: 'api/envs/disable',
params: { t: Date.now() },
body: JSON.stringify([eid]),
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
const token = await getToken();
const body = await api({
method: 'put',
url: 'api/envs/disable',
params: { t: Date.now() },
body: JSON.stringify([eid]),
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
};
module.exports.EnableCk = async (eid) => {
const token = await getToken();
const body = await api({
method: 'put',
url: 'api/envs/enable',
params: { t: Date.now() },
body: JSON.stringify([eid]),
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
const token = await getToken();
const body = await api({
method: 'put',
url: 'api/envs/enable',
params: { t: Date.now() },
body: JSON.stringify([eid]),
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
};
module.exports.getstatus = async(eid) => {
module.exports.getstatus = async (eid) => {
const envs = await this.getEnvs();
var tempid = 0;
for (let i = 0; i < envs.length; i++) {
tempid = 0;
tempid = 0;
if (envs[i]._id) {
tempid = envs[i]._id;
}
@@ -158,7 +160,7 @@ module.exports.getstatus = async(eid) => {
return 99;
};
module.exports.getEnvById = async(eid) => {
module.exports.getEnvById = async (eid) => {
const envs = await this.getEnvs();
var tempid = 0;
for (let i = 0; i < envs.length; i++) {
@@ -177,28 +179,28 @@ module.exports.getEnvById = async(eid) => {
};
module.exports.getEnvByPtPin = async (Ptpin) => {
const envs = await this.getEnvs();
for (let i = 0; i < envs.length; i++) {
var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
if(tempptpin==Ptpin){
return envs[i];
}
}
return "";
const envs = await this.getEnvs();
for (let i = 0; i < envs.length; i++) {
var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
if (tempptpin == Ptpin) {
return envs[i];
}
}
return "";
};
module.exports.delEnv = async (eid) => {
const token = await getToken();
const body = await api({
method: 'delete',
url: 'api/envs',
params: { t: Date.now() },
body: JSON.stringify([eid]),
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
const token = await getToken();
const body = await api({
method: 'delete',
url: 'api/envs',
params: { t: Date.now() },
body: JSON.stringify([eid]),
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8',
},
}).json();
return body;
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -53,6 +53,7 @@ pnpm i -g request@2.88.2
pnpm i -g jsdom@24.1.1
pnpm i -g moment@2.30.1
pnpm i -g cheerio@1.0.0
pnpm i -g tunnel
# pnpm install -g tough-cookie@4.1.4
pnpm i -g https-proxy-agent@7.0.5
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jieba

7
jd_nhj_draw.js Normal file

File diff suppressed because one or more lines are too long

7
jd_sjxnw.js Normal file

File diff suppressed because one or more lines are too long

7
jd_sxing_draw.js Normal file

File diff suppressed because one or more lines are too long

7
jd_wyw_check.js Normal file

File diff suppressed because one or more lines are too long

7
jd_xnjfq_award.js Normal file

File diff suppressed because one or more lines are too long

5
jd_xnjfq_task.js Normal file

File diff suppressed because one or more lines are too long