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

Method getOperateData

wxapp/ctrip.js:227–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

225 }
226
227 async getOperateData() {
228 if (!this.openid) throw new Error("缺少 openid,无法从 wx_server 获取运行数据");
229 const { data } = await axios.post(
230 `${wechat.serverUrl}/wx/getuserinfo`,
231 { appid: MINI_APP_ID, openid: this.openid },
232 {
233 headers: { auth: wechat.auth },
234 timeout: 30000,
235 validateStatus: () => true,
236 }
237 );
238 if (!data?.status) throw new Error(data?.message || "wx_server 获取 operatedata 失败");
239 const info = data.data || {};
240 if (!info.code || !info.iv || !info.encryptedData) {
241 throw new Error(`wx_server operatedata 缺少必要字段: ${JSON.stringify(data)}`);
242 }
243 return info;
244 }
245
246 async login() {
247 const op = await this.getOperateData();

Callers 1

loginMethod · 0.95

Calls 1

postMethod · 0.45

Tested by

no test coverage detected