MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / taskRequest

Method taskRequest

fenxiang.js:113–173  ·  view source on GitHub ↗
(method, url, body = "")

Source from the content-addressed store, hash-verified

111 }
112 }
113 async taskRequest(method, url, body = "") {
114 let re = function (e) {
115 function convertObjectToQueryString(obj) {
116 let queryString = "";
117 if (obj) {
118 const keys = Object.keys(obj).sort();
119 keys.forEach(key => {
120 const value = obj[key];
121 if (value !== null && typeof value !== 'object') {
122 queryString += `&${key}=${value}`;
123 }
124 });
125 }
126 return queryString.slice(1);
127 }
128 return convertObjectToQueryString(e)
129 }
130 function v(e) {
131 const crypto = require("crypto")
132 return crypto.createHash("md5").update(e).digest("hex")
133 }
134 const g = {
135 traceid: v((new Date).getTime().toString() + Math.random().toString()),
136 noncestr: Math.random().toString().slice(2, 10),
137 timestamp: Date.now(),
138 platform: "h5",
139 did: this.did,
140 version: "1.0.0",
141 finger: this.finger,
142 token: this.token,
143 oaid: this.oaid,
144 }
145 const c = "\u7c89\u8c61\u597d\u725b\u903ca8c19d8267527ea4c7d2f011acf7766f"
146 let s = method === "get" ? void 0 : JSON.parse(body)
147 let e = void 0 === s ? {} : s
148 g.sign = v(re(e) + re(g) + c)
149 let headers = {
150 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; MI 8 Lite Build/QKQ1.190910.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36 AgentWeb/5.0.0 UCBrowser/11.6.4.950',
151 'Accept': 'application/json, text/plain, */*',
152 'Accept-Encoding': 'gzip, deflate',
153 'Content-Type': 'application/json',
154 'origin': 'https://m.fenxianglife.com',
155 'sec-fetch-dest': 'empty',
156 'x-requested-with': 'com.n_add.android',
157 'sec-fetch-site': 'same-site',
158 'sec-fetch-mode': 'cors',
159 'referer': 'https://m.fenxianglife.com/h5-lottery/index.html?hideBack=1&sourceType=lottery_tab&token=030e7e9158af06dea2b3d0175a471ada&AppToken=96e06ae9f3cab6784de443015b8d9ad8&uid=515226607&v=5.4.3&did=njia992631e6-b9b2-4383-b67c-86b5d0fe818a&level=1&platform=android&timestamp=1717426249&channel=xiaomi&traFromId=23192687628924991393323633117947',
160 'accept-language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
161 "Content-Type": "application/json"
162 }
163 Object.assign(headers, g)
164 //console.log(headers)
165 const reqeuestOptions = {
166 url: url,
167 method: method,
168 headers: headers,
169 body: body
170 }

Callers 5

user_infoMethod · 0.95
task_finishMethod · 0.95
special_finishMethod · 0.95
sign_rewardMethod · 0.95
task_listMethod · 0.95

Calls 3

vFunction · 0.85
getTimeMethod · 0.80
httpRequestMethod · 0.45

Tested by

no test coverage detected