mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-05-07 03:48:44 +08:00
Compare commits
6 Commits
c770e90752
...
6dd13acc3b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6dd13acc3b | ||
![]() |
1e24b81f26 | ||
![]() |
cc17878bc6 | ||
![]() |
4eef47bd48 | ||
![]() |
cdfb72b517 | ||
![]() |
d3586e06af |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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)
|
||||
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',
|
||||
@ -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({
|
||||
@ -140,7 +142,7 @@ module.exports.EnableCk = async (eid) => {
|
||||
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++) {
|
||||
@ -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++) {
|
||||
@ -180,7 +182,7 @@ 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){
|
||||
if (tempptpin == Ptpin) {
|
||||
return envs[i];
|
||||
}
|
||||
}
|
||||
|
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
19
jd_dplh0117.js
Normal file
19
jd_dplh0117.js
Normal file
File diff suppressed because one or more lines are too long
19
jd_dplh0121.js
Normal file
19
jd_dplh0121.js
Normal file
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
78
jd_indeps.sh
78
jd_indeps.sh
@ -1,46 +1,64 @@
|
||||
#!/usr/bin/env bash
|
||||
#依赖安装,运行一次就好
|
||||
#依赖安装
|
||||
#0 8 5 5 * jd_indeps.sh
|
||||
#new Env('依赖安装')
|
||||
#new Env('依赖安装');
|
||||
#updatedate:20240903
|
||||
#
|
||||
|
||||
npm_ver=$(pnpm -v | awk -F. '{print $1}')
|
||||
if [[ $npm_ver -ge 7 ]]; then
|
||||
DIR="$( pwd )"
|
||||
dir_root=/ql
|
||||
dir_repo=$dir_root/repo
|
||||
dir_deps=$dir_root/deps
|
||||
|
||||
if [[ $AUTOCFG == 'true' ]];then
|
||||
if [[ -z "$(echo "$DIR"|grep 'main')" ]];then
|
||||
dir_code=$dir_log/6dylan6_jdpro_jd_sharecode
|
||||
repo='6dylan6_jdpro'
|
||||
else
|
||||
dir_code=$dir_log/6dylan6_jdpro_main_jd_sharecode
|
||||
repo='6dylan6_jdpro_main'
|
||||
fi
|
||||
[[ -d $dir_root/data ]] && dir_data=$dir_root/data
|
||||
[[ -d $dir_data/repo ]] && dir_repo=$dir_data/repo
|
||||
[[ -d $dir_data/deps ]] && dir_deps=$dir_data/deps
|
||||
cp $dir_repo/${repo}/sendNotify.js $dir_deps/ > /dev/null 2>&1
|
||||
echo -e "\n已配置sendNotify.js文件到deps目录下,再次执行订阅生效\n"
|
||||
else
|
||||
echo -e "\n如需自动配置sendNotify.js文件到desp目录下,请配置变量AUTOCFG='true'\n"
|
||||
fi
|
||||
|
||||
npm_ver=`pnpm -v|awk -F. '{print $1}'`
|
||||
if [[ $npm_ver -ge 7 ]];then
|
||||
export PNPM_HOME="/root/.local/share/pnpm"
|
||||
export PATH="$PNPM_HOME:$PATH"
|
||||
fi
|
||||
|
||||
echo -e "安装脚本所需依赖,不一定一次全部安装成功,请自己检查\n"
|
||||
echo -e "安装本库所需依赖,不一定一次全部安装成功,完成请检查\n"
|
||||
echo -e "开始安装............\n"
|
||||
|
||||
#apk add g++ make pixman-dev pango-dev cairo-dev pkgconf --no-cache
|
||||
apk add g++ make --no-cache
|
||||
#apk add g++ make --no-cache
|
||||
pnpm config set registry https://registry.npmmirror.com
|
||||
pnpm install -g
|
||||
pnpm install -g adler-32
|
||||
pnpm install -g png-js
|
||||
pnpm install -g date-fns
|
||||
pnpm install -g axios@1.6.7
|
||||
pnpm install -g crypto-js
|
||||
pnpm install -g ts-md5
|
||||
pnpm install -g tslib
|
||||
pnpm install -g global-agent
|
||||
pnpm install -g @types/node
|
||||
pnpm install -g request
|
||||
pnpm install -g jsdom
|
||||
pnpm install -g crc
|
||||
pnpm install -g qs
|
||||
pnpm install -g moment
|
||||
pnpm install -g cheerio
|
||||
pnpm install -g dotenv
|
||||
pnpm install -g got@11.8.6
|
||||
pnpm install -g sharp@0.32.6
|
||||
pnpm install -g tough-cookie
|
||||
pnpm install -g https-proxy-agent@7.0.2
|
||||
pnpm install -g http-cookie-agent
|
||||
pnpm install -g console-table-printer@2.12.0
|
||||
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jieba
|
||||
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ requests
|
||||
pnpm i -g tough-cookie
|
||||
pnpm i -g ds@2.0.2
|
||||
pnpm i -g png-js@1.0.0
|
||||
pnpm i -g date-fns@3.6.0
|
||||
pnpm i -g axios@1.7.4
|
||||
pnpm i -g crypto-js@4.2.0
|
||||
# pnpm install -g ts-md5@1.3.1
|
||||
# pnpm install -g tslib@2.6.3
|
||||
# pnpm install -g @types/node@22.4.0
|
||||
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.doubanio.com/simple/ jieba
|
||||
pip3 install -i https://pypi.doubanio.com/simple/ requests
|
||||
rm -rf /usr/local/pnpm-global/5/node_modules/.pnpm/canvas*
|
||||
rm -rf /root/.local/share/pnpm/global/5/.pnpm/canvas*
|
||||
pnpm i -g sharp@0.32.0
|
||||
echo -e "\n所需依赖安装完成,请检查有没有报错,可尝试再次运行"
|
File diff suppressed because one or more lines are too long
14
jd_opencard_0107.js
Normal file
14
jd_opencard_0107.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -730,18 +730,20 @@ async function try_feedsList(tabId, page) {
|
||||
}
|
||||
}
|
||||
|
||||
async function h5stSign(body, appId, version = '5.0.3') {
|
||||
async function h5stSign(body, appId, version) {
|
||||
const options = {
|
||||
method: 'POST',
|
||||
url: `${args_xh.h5st_server}/h5st`,
|
||||
headers: { 'content-type': 'application/json' },
|
||||
data: {
|
||||
version: version,
|
||||
pin: $.UserName,
|
||||
ua: $.userAgent,
|
||||
body,
|
||||
appId,
|
||||
},
|
||||
if (version) {
|
||||
data.version = version;
|
||||
}
|
||||
};
|
||||
const { data } = await axios.request(options);
|
||||
return data.body;
|
||||
|
File diff suppressed because one or more lines are too long
1137
utils/baseUtils.js
1137
utils/baseUtils.js
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user