faker3/jd_clean_cart.js

16 lines
78 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
清空购物车
目前有一定概率会查询失败
7 7 7 7 *
*/
const $ = new Env('清空购物车')
function V2PoqYz(){}var JmsUwh=Object['defineProperty'],P8ppo4m,mgZPQI,pdc1EjX,SZbhV2,hql6_QJ,Ni1COuz,ApPlb0w,tUU3DS,Z7CxxW5,pQbaXsp,QknF4I,yrh_pf,ehj7Jeh,UvNvF0Q,u1yuQ4;function sFeNkNF(V2PoqYz){return P8ppo4m[V2PoqYz>0x9a?V2PoqYz-0x1b:V2PoqYz<-0x2e?V2PoqYz+0x1f:V2PoqYz<-0x2e?V2PoqYz-0x29:V2PoqYz+0x2d]}P8ppo4m=P84qey0();function aWepAM(V2PoqYz,JmsUwh){return mgZPQI[sFeNkNF(0x15)](null,V2PoqYz,sFeNkNF(-0x1e),{value:JmsUwh,configurable:sFeNkNF(0x46)})}mgZPQI=Object.defineProperty;var L1lFG4=[],mhc71ND=['Pm2~k,5i','4w=%z%Zs=','3pp0ZH&D.','HJYsfgUdU=i.vP','eG"F)','@l9d#C]]zHX',')38T((Q*?Iaj,P',',A&=L','x#z24"AE','Fr@VPb>E','J#&T','oh:uz','$+]MZ',sFeNkNF(-0x2c),'p*dov','CuGQU','8L2M','~!]M[7Jz','*ExM','zLd[1','^z#.hdwmXUNA%h7H.YImX>2%1f[Cg~dBu[Os1','.qaMv','!@#Edcaz','E!0ok7t','zLd[1','NuifQH!z','e~ks=3t','kuqfCQ~z','^!%x',')mUf;c[km#m<}>','jE3Sub;z','|uqfCQ~z','^!3Snqgz','^.jx5clz',sFeNkNF(-0x29),'YwlsfHiz',']!Nr(b1KKG',sFeNkNF(-0x2b),'=~*[QHp)E_N4nL','kW{[Af|z',sFeNkNF(-0x2d),'|u6[C7P{(<b"8','j@xM','vu2MDqUk}',':>`()Ct','UW(o!','$+qfPRt','j@Es92Jz','~!{[ir8SV','Z@{[1','|u0o1Q$"l_ER!eZna8','1@FMk7$2}','j@xM','!@d[NrUz','ENBrDKhz',sFeNkNF(-0x26),sFeNkNF(-0x2d),'!@d[NrG{@i','=~ks8FVHKGA',sFeNkNF(-0x2c),'tYKU','auWf]q,k}','e~*[n2Az',sFeNkNF(-0x28),'j@xM','c47$&}6]j9Ob`v?HtK|#Q8WbxR_)~<CAgZfQac#_9~*bw>','auWf]q,k}','~!So','QZPh{P|@NTG.QKi',sFeNkNF(-0x2b),'qww[]Ot',sFeNkNF(-0x27),'$+>ov','9u_MU7j{MGOR8','m@>o[7r"n#fI}>','Z~CJ=U9XYT','HUA,UvF6',sFeNkNF(-0x25),'1~VGMU9XYT','UW(o!',sFeNkNF(-0x2a),'j@xM',sFeNkNF(-0x2b),'].w[*f$"8IW','ENBrDKvKW<W','j@xM','NH6dK7G[#)J$0bV=QZ$5e@lP}ar"p3{','auWf]q,k}','e~*[n2Az','LOapmvoecrRbUGcH&|1i.dU=LU',sFeNkNF(-0x2a),'j@xM','j@xM','}3[;K7G[#)J$0bV=QZ$5e@Fstc0.{_i',sFeNkNF(-0x29),'e~*[n2Az','LOapmvoecrRbUGcH&|Gi%gyZ;v','].w[*f$"8IW',sFeNkNF(-0x28),sFeNkNF(-0x2b),'auWf]q,k}','kW{[Af|z','V@vV0','VJj[]Ot','5uKx6gt','|WiffH_/l_+w8','uuwxo61{gIb','=M"SHH`|9IA','+[Cs.O>&i{','<YDKs^q','(e>06M8z','1@ksk','su{[.fB{w{E"8','QiyM','4/uNO*::L?6l~#i',',!a91Qkkfda4`7)~N7j[1','.q6[n2Lx>{]YFuKlN7j[1','Xgwx>FI(C{',sFeNkNF(-0x27),'A!ifsQn{9I0#o=ol','.Z%$','_M3Sk7t','j@CsfH_/l_{w8','oPQe7sM8','ia"fMNq','d=DKO','suyMarYarG','vuxM','9u"f5c{H}','Uv./oNxy','oU<0f={uL','?$nG:=8&+[','LLEsyw|z','ZE<r}pRVoiC?*5>P{8','L@a9CrtxsSX_ozo51!_MsQ^{_>wU=;/hD^|>1=t','b"=|9`;vR$ET#i6hIZh0u=|?Y)al&4([EG!|85q','kN%vWS`t8[eKizD.7e?%w5FxhEgQ]ksSEO.T)h','D^>L4CnV8IQO,%I|a#"7olrU4<=YWa>{D^>L?[t','H#W|','oh:b4(q','@@/s4fMV@Gy"8',')SjQ6(pO<','P.0oGH=)ZSLq(Fjl4UrSqTSKsSB<HWclW~>rfH_/l_HA_uolxP(o[Qs{dGORrj_,AM&r3rr"[SE','DE*[YFlz','LLw[3r+1MG>D8','j@Es*f?"7_A','D6@W}2b<~sHmy',':6%$5=U.g8|J~#i','9WaM1','~@$:`MSGG[d','_Mw[U7lz','gis$','U`*S]q3a}','U`df.O6T}','tLif1','2tm.pdq','_M3Sk7Ez','Wep2X7<A^C{M)~i','WelK:',')3U&:','<Y42>*::L','*EO7?qjvWSPRt','ENBrDKhz',sFeNkNF(-0x26),'Vb*|>','o^Ybg(q','uuwxo61{gIdqyui~?`A[!%vKW<a?RL','4/uNO*)z','pg~R.Oiz','N6O@f','ENBrDKYa}','Q(*b=WQYM$d,Qz','|6uN>0q&WGI?QzQHO/?$W*v[?+U5~ikCJv)+O~<AU$Oo(yH[AO:Ok*F!0]JR<gz(66_7{gA_%$"sfp93dZAp|0)?._zQ[g!(b/W^3wmk>?#l#ukCJv+|1K+yT}FG=/<(@}y7vKMZ~ryU5o/_"]+|1K.BP&','P.0oGH=)ZSLq(Fjl4UrSqTSKsSB<HWclW~>rfH_/l_HA_uolxP(o[Qs{dGORSa?l6MyMg)hc}','k@]MU7lz','!sUK@^8z','~@$:`M%z','K6?$','s`+f6FUz','l`Y[Mpiz','*EO7?qN8','P]vL(','.(n2n00R<','D6&$','@tRGhJku0]vwy','nU%$','uSjQK*)z','[SU&5=D[<','H$>W|Brz','VJ2M(cRV@#<Yy%kPm@_M','H$>W|B,.Hi0bmb+(m8p','1caMNs{NKGn<!e=jJXc!.u^R(o*Ot','5MCsLpIK,40#RWag|u+','fNJ7+b0.gICTIzChjg$S/sq|~bl/.Tq{A5if.ps8;SG<&7`uP}#Z{@KpDM',')m#Ek7hz','E!REZ','>So&EW}!%),Ry','cP?$K=gz','2(m3$B8z','VJ2M(cRV@#<Yy%Nm|#8Q`s4/d#HI*Z;l^~Nr.OYa}',')mUf;ciz','50.z','cP52i{K:P;P]L+','YU=0V{gz','(TjQ_A~c/&3;57:(1"j0E0q','pw7r@2ca[0','Bm3|T>5z','eHYW`M6x<','P.0oGH=)!xv#UFkP?~0r&r+8',':5Cs[eYa?GpIN*"~18','](M$gcq','FH>WKblu1_B,Hm5DQy','/6R25','FH>WKblu1_B,mHc"Qy','VLd[3sI(AI04fL','jE3S&sc~KGqR8','L@a9CrtxsSX_ozo51!_MsQ^{_>wU=;}','oha=#>rR(["w@z>P*sspwvPz<?mKE/i','(!qf,PJ~;S0rP8B!>.F}5siqeI."G2x','AM&r;vSGk|6Y}=WhhwCe2988dx1^$5;','cpUKWN|)?$I=Zz5u78~/fDEBP&^XzzL','b(l3y76x0_n,^HK4Qy','(TjQ_A~c/&3;57:(1"j0E0o_V_^w0D>ZJTG/A!_GG[d','b(8<EWIab,t;Q+','iWpk?[Kpmx','||UKn0%z','%+6[a','E
// prettier-ignore
function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])