mirror of
https://github.com/6dylan6/jdpro.git
synced 2026-04-20 11:03:08 +08:00
Compare commits
15 Commits
ab5953567a
...
43909ff996
| Author | SHA1 | Date | |
|---|---|---|---|
| 43909ff996 | |||
| b09f0de143 | |||
| 0da473a08c | |||
| 3e4cfce4bd | |||
| f71a15a657 | |||
| 6ad4dce833 | |||
| b048de83b8 | |||
| 01610e0ae1 | |||
| 20e6026473 | |||
| b610cc2646 | |||
| 2009c0dbb1 | |||
| 87db7cb8db | |||
| d89e8d7712 | |||
| bc8b84a1b8 | |||
| 005fe03104 |
@@ -0,0 +1 @@
|
||||
Welcome to my GitHub profile!
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+9
-7
@@ -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({
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user