MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / getUserToken

Method getUserToken

wxapp/guyu.js:65–107  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

63 await this.getUserPoints()
64 }
65 async getUserToken(code) {
66 let data = JSON.stringify({
67 "code": "" + code,
68 "appid": "wxda948f3be0afc375",
69 "shopId": null,
70 "envVersion": "release",
71 "isEnterpriseWx": false,
72 "scene": 1168,
73 "referrerInfo": {
74 "appId": "wxda948f3be0afc375"
75 }
76 });
77
78 let options = {
79 method: 'POST',
80 url: 'https://mall-mobile-v6.vecrp.com/mobile/wxAppLogin',
81 headers: {
82 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781 NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/50249',
83 'Content-Type': 'application/json;charset=UTF-8',
84 'xweb_xhr': '1',
85 'appid': 'wxda948f3be0afc375',
86 'token': '',
87 'Sec-Fetch-Site': 'cross-site',
88 'Sec-Fetch-Mode': 'cors',
89 'Sec-Fetch-Dest': 'empty',
90 'Referer': 'https://servicewechat.com/wxda948f3be0afc375/65/page-frame.html',
91 'Accept-Language': 'zh-CN,zh;q=0.9'
92 },
93 data: data
94 };
95
96 let {
97 data: result
98 } = await axios.request(options);
99 console.log(result);
100
101 if (result?.success) {
102 this.token = result.result.mobileToken
103 $.log(`🌸账号[${this.index}] 获取用户Token成功:${this.token}`)
104 } else {
105 $.log(`🌸账号[${this.index}] 获取用户Token-失败:${result.message}❌`)
106 }
107 }
108 sha1(str) {
109 return require("crypto").createHash("sha1").update(str).digest("hex");
110 }

Callers 1

runMethod · 0.95

Calls 2

requestMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected