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

Function assertOk

wxapp/junpinhui.js:107–112  ·  view source on GitHub ↗
(res, action)

Source from the content-addressed store, hash-verified

105}
106
107function assertOk(res, action) {
108 if (!res || !okCode(res)) {
109 throw new Error(`${action}失败: ${res?.message || res?.msg || res?.errMsg || shortJson(res, 500)}`);
110 }
111 return res.data;
112}
113
114async function request(method, base, urlPath, { token = "", data = null, params = null } = {}) {
115 const res = await axios({

Callers 3

loginMethod · 0.70
gardenGetMethod · 0.70
gardenPostMethod · 0.70

Calls 2

okCodeFunction · 0.85
shortJsonFunction · 0.85

Tested by

no test coverage detected