mirror of
https://github.com/6dylan6/jdpro.git
synced 2026-04-19 09:19:03 +00:00
Compare commits
No commits in common. "826b66f81e30ec53941cbda9803558baf72a49cf" and "d7403519a140263ce2fdf0208b2af8e385baad93" have entirely different histories.
826b66f81e
...
d7403519a1
File diff suppressed because one or more lines are too long
@ -7,15 +7,10 @@ const path = require('path');
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const tokenFileList = ['/ql/data/db/keyv.sqlite', '/ql/data/config/auth.json', '/ql/config/auth.json'];
|
const tokenFileList = ['/ql/data/db/keyv.sqlite', '/ql/data/config/auth.json', '/ql/config/auth.json'];
|
||||||
let authFile = getLatestFile(tokenFileList);
|
let authFile = getLatestFile(tokenFileList);
|
||||||
const HOSTS = ['http://127.0.0.1:5600','http://127.0.0.1:5700'];
|
const api = got.extend({
|
||||||
function api(options){
|
prefixUrl: 'http://127.0.0.1:5600',
|
||||||
const req = got.extend({prefixUrl: HOSTS[0],retry:{limit:0},timeout:{request:5000}})(options);
|
retry: { limit: 0 },
|
||||||
['json','text','buffer'].forEach(m=>{
|
|
||||||
const orig=req[m].bind(req);
|
|
||||||
req[m]=()=>orig().catch(e=>['ECONNREFUSED','ETIMEDOUT'].includes(e.code)?got.extend({prefixUrl:HOSTS[1],retry:{limit:0},timeout:{request:5000}})(options)[m]():Promise.reject(e));
|
|
||||||
});
|
});
|
||||||
return req;
|
|
||||||
}
|
|
||||||
function getLatestFile(files) {
|
function getLatestFile(files) {
|
||||||
let latestFile = null;
|
let latestFile = null;
|
||||||
let latestMtime = 0;
|
let latestMtime = 0;
|
||||||
|
|||||||
7
jd_dplh0105.js
Normal file
7
jd_dplh0105.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
Loading…
Reference in New Issue
Block a user