1
0
mirror of https://github.com/6dylan6/jdpro.git synced 2026-04-21 11:52:06 +08:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Tangcong ab5953567a Merge 005fe03104 into a1515db74e 2025-01-10 20:25:12 +08:00
11 changed files with 147 additions and 178 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+7 -9
View File
@@ -4,17 +4,16 @@ 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 (Fileexists280)
authFile = "/ql/data/db/keyv.sqlite"
else if (Fileexists)
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',
@@ -22,11 +21,10 @@ const api = got.extend({
});
async function getToken() {
const authConfig = await readFile(authFile);
// console.log(authConfig.toString().match(/"token":"(.*?)",/)[1])
return authConfig.toString().match(/"token":"(.*?)",/)[1];
const authConfig = JSON.parse(await readFile(authFile));
return authConfig.token;
}
// getToken()
module.exports.getEnvs = async () => {
const token = await getToken();
const body = await api({
+1 -1
View File
File diff suppressed because one or more lines are too long
+12
View File
File diff suppressed because one or more lines are too long
-1
View File
@@ -53,7 +53,6 @@ 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
View File
File diff suppressed because one or more lines are too long
-7
View File
File diff suppressed because one or more lines are too long
-7
View File
File diff suppressed because one or more lines are too long
-7
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-5
View File
File diff suppressed because one or more lines are too long