Skip to content

Commit

Permalink
checkck改成实时获取
Browse files Browse the repository at this point in the history
  • Loading branch information
ccwav committed Nov 16, 2021
1 parent ab3ca1d commit af0bf9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jd_CheckCK.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
const got = require('got');
const {
getEnvs,
getEnvById,
DisableCk,
EnableCk,
getstatus
Expand Down Expand Up @@ -138,7 +139,7 @@ if ($.isNode() && process.env.CHECKCK_ALLNOTIFY) {

for (let i = 0; i < envs.length; i++) {
if (envs[i].value) {
cookie = envs[i].value;
cookie = await getEnvById(envs[i]._id);
$.UserName = (cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
$.UserName2 = decodeURIComponent($.UserName);
$.index = i + 1;
Expand Down
10 changes: 10 additions & 0 deletions ql.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ module.exports.getstatus = async (eid) => {
return 99;
};

module.exports.getEnvById = async (eid) => {
const envs = await this.getEnvs();
for (let i = 0; i < envs.length; i++) {
if(envs[i]._id==eid){
return envs[i].value;
}
}
return "";
};

module.exports.delEnv = async (eid) => {
const token = await getToken();
const body = await api({
Expand Down

0 comments on commit af0bf9a

Please sign in to comment.