MCPcopy Create free account
hub / github.com/Semporia/Scripts / getJxFactory

Function getJxFactory

jd_get_share_code.js:97–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95 })
96}
97function getJxFactory(){
98 const JX_API_HOST = "https://m.jingxi.com";
99
100 function JXGC_taskurl(functionId, body = "") {
101 return {
102 url: `${JX_API_HOST}/dreamfactory/${functionId}?zone=dream_factory&${body}&sceneval=2&g_login_type=1&_time=${Date.now()}&_=${Date.now()}`,
103 headers: {
104 Cookie: cookie,
105 Host: "m.jingxi.com",
106 Accept: "*/*",
107 Connection: "keep-alive",
108 "User-Agent":
109 "jdpingou;iPhone;3.14.4;14.0;ae75259f6ca8378672006fc41079cd8c90c53be8;network/wifi;model/iPhone10,2;appBuild/100351;ADID/00000000-0000-0000-0000-000000000000;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/62;pap/JA2015_311210;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
110 "Accept-Language": "zh-cn",
111 Referer: "https://wqsd.jd.com/pingou/dream_factory/index.html",
112 "Accept-Encoding": "gzip, deflate, br",
113 },
114 };
115 }
116
117 return new Promise(resolve => {
118 $.get(
119 JXGC_taskurl(
120 "userinfo/GetUserInfo",
121 `pin=&sharePin=&shareType=&materialTuanPin=&materialTuanId=`
122 ),
123 async (err, resp, data) => {
124 try {
125 if (err) {
126 console.log(`${JSON.stringify(err)}`);
127 console.log(`京喜工厂 API请求失败,请检查网路重试`);
128 } else {
129 if (safeGet(data)) {
130 data = JSON.parse(data);
131 if (data["ret"] === 0) {
132 data = data["data"];
133 $.unActive = true; //标记是否开启了京喜活动或者选购了商品进行生产
134 $.encryptPin = "";
135 $.shelvesList = [];
136 if (data.factoryList && data.productionList) {
137 const production = data.productionList[0];
138 const factory = data.factoryList[0];
139 const productionStage = data.productionStage;
140 $.factoryId = factory.factoryId; //工厂ID
141 $.productionId = production.productionId; //商品ID
142 $.commodityDimId = production.commodityDimId;
143 $.encryptPin = data.user.encryptPin;
144 // subTitle = data.user.pin;
145 console.log(`【京东账号${$.index}(${$.UserName})京喜工厂】${data.user.encryptPin}`);
146 }
147 } else {
148 $.unActive = false; //标记是否开启了京喜活动或者选购了商品进行生产
149 if (!data.factoryList) {
150 console.log(
151 `【提示】京东账号${$.index}[${$.nickName}]京喜工厂活动未开始请手动去京东APP->游戏与互动->查看更多->京喜工厂 开启活动`
152 );
153 } else if (data.factoryList && !data.productionList) {
154 console.log(

Callers 1

getShareCodeFunction · 0.85

Calls 5

JXGC_taskurlFunction · 0.85
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected