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

Method getUserInfo

wxapp/musi.js:113–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111 return crypto.createHash('md5').update(str).digest('hex');
112 }
113 async getUserInfo() {
114 try {
115 const timestamp = new Date().getTime();
116 let options = {
117 method: 'POST',
118 url: `https://atom.musiyoujia.com/member/wechatlogin/selectuserinfo`,
119 headers: {
120 'Content-Type': 'application/json',
121 'User-Agent': defaultUserAgent,
122 "api_client_code": "65",
123 "api_version": "1.0.0",
124 'api_timestamp': timestamp,
125 'api_token': this.activedAuthToken,
126
127 'api_sign': this.MD5_Encrypt(`api_client_code=65&api_version=1.0.0&api_timestamp=${timestamp}`)?.toUpperCase()
128
129 },
130 data: { "appId": "wx03527497c5369a2c", "appType": "WECHAT_MINI_PROGRAM", "openId": `${this.openId}` }
131 }
132 let { data: result } = await axios.request(options)
133
134
135 if (result?.msg === "success") {
136 this.valid = true;
137 this.customId = result?.data.resMemberInfo.memberId;
138 $.log(`账号[${this.index}] 查询个人信息成功,积分:${result?.data?.memberInfo?.pointInfo?.point}`)
139 } else {
140 $.log(`账号[${this.index}] 查询个人信息失败:${result?.msg || JSON.stringify(result)}`)
141 this.valid = false
142 }
143
144 } catch (e) {
145 console.log(e)
146 }
147 }
148
149 async getJob() {
150 try {

Callers 1

runMethod · 0.95

Calls 4

MD5_EncryptMethod · 0.95
getTimeMethod · 0.80
requestMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected