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

Method getLoginCode

wxapp/mxbc.js:158–165  ·  view source on GitHub ↗
(force = false)

Source from the content-addressed store, hash-verified

156 };
157 }
158 async getLoginCode(force = false) {
159 if (this.loginCode && !force) return this.loginCode;
160 const { data: codeRes } = await wechat.getCode(this.wcsid);
161 const code = codeRes?.code || codeRes?.data?.code;
162 if (!code) throw new Error(`wx_server 未返回 code: ${JSON.stringify(codeRes)}`);
163 this.loginCode = code;
164 return this.loginCode;
165 }
166 async getOpenId() {
167 try {
168 let options = {

Callers 1

getOpenIdMethod · 0.95

Calls 1

getCodeMethod · 0.45

Tested by

no test coverage detected