mirror of
https://github.com/6dylan6/jdpro.git
synced 2025-07-13 16:13:07 +08:00
1
This commit is contained in:
9
jx_ttlhb.js
Normal file
9
jx_ttlhb.js
Normal file
File diff suppressed because one or more lines are too long
@ -2125,22 +2125,28 @@ function GetnickName2() {
|
||||
}
|
||||
const got = require('got');
|
||||
require('dotenv').config();
|
||||
let exists = fs.existsSync('/ql/data/config/auth.json');
|
||||
let authFile="";
|
||||
if (exists)
|
||||
authFile="/ql/data/config/auth.json"
|
||||
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_)
|
||||
authFile = "/ql/data/config/auth.json"
|
||||
else
|
||||
authFile="/ql/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(fs.readFileSync(authFile));
|
||||
return authConfig.token;
|
||||
const authConfig = await fs.readFileSync(authFile);
|
||||
// console.log(authConfig.toString().match(/"token":"(.*?)",/)[1])
|
||||
return authConfig.toString().match(/"token":"(.*?)",/)[1];
|
||||
}
|
||||
// getToken()
|
||||
|
||||
async function getEnvs(){
|
||||
const token = await getToken();
|
||||
|
Reference in New Issue
Block a user