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

Method getOperateData

wxapp/haitian.js:213–229  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

loginByWxCodeMethod · 0.95

Calls 1

postMethod · 0.45

Tested by

no test coverage detected