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

Method miniRequest

wxapp/oppo.js:167–181  ·  view source on GitHub ↗
(method, path, data = {})

Source from the content-addressed store, hash-verified

165 }
166
167 async miniRequest(method, path, data = {}) {
168 const upperMethod = method.toUpperCase();
169 const { status, data: result } = await request({
170 method: upperMethod,
171 url: `${MINI_API}${path}`,
172 headers: this.miniHeaders(),
173 params: upperMethod === "GET" ? data : undefined,
174 data: upperMethod === "GET" ? undefined : data,
175 });
176 if (status !== 200) throw new Error(`${path} HTTP ${status}: ${short(result)}`);
177 if (result?.ret && String(result.ret) !== "1") {
178 throw new Error(`${path} 失败: ${result.errMsg || result.message || short(result)}`);
179 }
180 return result;
181 }
182
183 async h5Request(method, path, data = {}) {
184 const upperMethod = method.toUpperCase();

Callers 2

queryMemberMethod · 0.95
queryEntranceMethod · 0.95

Calls 3

miniHeadersMethod · 0.95
requestFunction · 0.70
shortFunction · 0.70

Tested by

no test coverage detected