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

Method getWxCode

wxapp/yichengtong.js:180–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178 }
179
180 async getWxCode() {
181 if (!this.openid) throw new Error("缺少 openid,无法从 wx_server 获取 code");
182 const { data } = await wechat.getCode(this.openid);
183 if (!data?.status) throw new Error(data?.message || "wx_server 获取 code 失败");
184 const code = data.data?.code || data.code;
185 if (!code) throw new Error(`wx_server 未返回 code: ${JSON.stringify(data)}`);
186 return code;
187 }
188
189 async getOperateData() {
190 if (!this.openid) throw new Error("缺少 openid,无法从 wx_server 获取授权数据");

Callers 1

loginByCodeMethod · 0.95

Calls 1

getCodeMethod · 0.45

Tested by

no test coverage detected