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

Method jscode2session

wxapp/hezj.js:123–138  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

121 }
122
123 async jscode2session(code) {
124 const path = "/api-gw/oauthserver/applet/v1/jscode2session";
125 let options = {
126 method: "POST",
127 url: API_HOST + path,
128 path,
129 isSign256: true,
130 isHeaderDelToken: true,
131 data: { code },
132 };
133 const { data: result } = await this.request(options);
134 if (result?.retCode !== "00000" && result?.code !== 200 && !result?.success) {
135 throw new Error(result?.retInfo || result?.message || JSON.stringify(result));
136 }
137 return result?.data?.tokenInfo || result?.data || {};
138 }
139
140 async queryUserInfo(accountToken) {
141 const path = "/api-gw/oauthserver/applet/v1/userinfo/query";

Callers 1

loginByWxCodeMethod · 0.95

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected