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

Function getMyPin

jd_wxFans.js:213–239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

211
212//获取我的pin
213function getMyPin() {
214 let config = taskPostUrl("/customer/getMyPing", `userId=${$.shopid}&token=${encodeURIComponent($.token2)}&fromType=APP`)
215 // console.log(config)
216 return new Promise(resolve => {
217 $.post(config, async (err, resp, data) => {
218 try {
219 if (err) {
220 console.log(`${JSON.stringify(err)}`)
221 console.log(`${$.name} API请求失败,请检查网路重试`)
222 } else {
223 data = JSON.parse(data);
224 if (data.data && data.data.secretPin) {
225 $.pin = data.data.secretPin
226 // console.log($.pin)
227 $.nickname = data.data.nickname
228 // console.log(data)
229 console.log(`欢迎回来~ ${$.nickname}`);
230 }
231 }
232 } catch (e) {
233 $.logErr(e, resp)
234 } finally {
235 resolve(data);
236 }
237 })
238 })
239}
240
241function adlog() {
242 let config = taskPostUrl("/common/accessLogWithAD", `venderId=${$.shopid}&code=69&pin=${encodeURIComponent($.pin)}&activityId=90121061401&pageUrl=https://lzkjdz-isv.isvjcloud.com/wxFansInterActionActivity/activity/590580?activityId=aae88e19901340a28b604f5cf5b61dd6&shareuserid4minipg=jd_4806fb66e0f3e&shopid=undefined&subType=app&adSource=`)

Callers 1

jd_wxFans.jsFile · 0.70

Calls 4

taskPostUrlFunction · 0.70
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected