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

Method getOperateData

wxapp/iqoo.js:210–225  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

208 }
209
210 async getOperateData() {
211 if (!process.env.wx_auth) throw new Error("缺少 wx_auth,无法从 wx_server 获取登录数据");
212 const url = (process.env.wx_server_url || "http://192.168.31.196:8787").replace(/\/$/, "");
213 const { data } = await axios.post(`${url}/wx/getuserinfo`, {
214 appid: MINI_APP_ID,
215 openid: this.openid,
216 }, {
217 headers: { auth: process.env.wx_auth },
218 timeout: 45000,
219 });
220 const result = data?.data || {};
221 if (!data?.status || !result.code || !result.encryptedData || !result.iv) {
222 throw new Error(`wx_server 未返回完整登录数据: ${JSON.stringify(data)}`);
223 }
224 return result;
225 }
226
227 async loginByWxCode() {
228 try {

Callers 1

loginByWxCodeMethod · 0.95

Calls 1

postMethod · 0.45

Tested by

no test coverage detected