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

Method getOperateData

wxapp/fuyouhui.js:180–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178 }
179
180 async getOperateData() {
181 if (!this.openid) throw new Error("缺少 openid,无法自动授权");
182 const { data } = await axios.post(
183 `${wechat.serverUrl}/wx/getuserinfo`,
184 { appid: MINI_APP_ID, openid: this.openid },
185 {
186 headers: { auth: wechat.auth },
187 timeout: 30000,
188 validateStatus: () => true,
189 }
190 );
191 if (!data?.status) throw new Error(data?.message || "wx_server 获取 operatedata 失败");
192 const info = data.data || {};
193 if (!info.code || !info.iv || !info.encryptedData) {
194 throw new Error(`wx_server operatedata 缺少必要字段: ${JSON.stringify(data)}`);
195 }
196 return info;
197 }
198
199 async loginByOperateData() {
200 const op = await this.getOperateData();

Callers 1

loginByOperateDataMethod · 0.95

Calls 1

postMethod · 0.45

Tested by

no test coverage detected