1
0
mirror of https://github.com/6dylan6/jdpro.git synced 2026-04-15 03:18:36 +08:00

Compare commits

...

5 Commits

Author SHA1 Message Date
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
5 changed files with 152 additions and 143 deletions

View File

@@ -4,16 +4,17 @@ 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)
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');
const api = got.extend({
prefixUrl: 'http://127.0.0.1:5600',
@@ -21,10 +22,11 @@ const api = got.extend({
});
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];
}
// getToken()
module.exports.getEnvs = async () => {
const token = await getToken();
const body = await api({

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