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

Method getUserToken

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

Source from the content-addressed store, hash-verified

63 await this.doSign()
64 }
65 async getUserToken(code) {
66 let data = ({
67 "code": code,
68 "appId": "wxed3cf95a14b58a26"
69 });
70
71 let options = {
72 method: 'POST',
73 url: 'https://stdcrm.dtmiller.com/std-weixin-mp-service/miniApp/custom/login',
74 headers: {
75 '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',
76 'Content-Type': 'application/json',
77 'xweb_xhr': '1',
78 'authorization': '',
79 'sec-fetch-site': 'cross-site',
80 'sec-fetch-mode': 'cors',
81 'sec-fetch-dest': 'empty',
82 'referer': 'https://servicewechat.com/wxed3cf95a14b58a26/255/page-frame.html',
83 'accept-language': 'zh-CN,zh;q=0.9'
84 },
85 data: data
86 };
87 let {
88 data: result
89 } = await axios.request(options);
90
91 if (result?.code == '0') {
92 this.token = result.data
93 $.log(`🌸账号[${this.index}] 获取用户Token成功:${this.token}`)
94 } else {
95 $.log(`🌸账号[${this.index}] 获取用户Token-失败:${result.msg}❌`)
96 }
97 }
98 async getUserInfo() {
99 let options = {
100 method: 'GET',

Callers 1

runMethod · 0.95

Calls 2

requestMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected