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

Method getSignedBody

wxapp/mxbc.js:121–139  ·  view source on GitHub ↗
(params = {})

Source from the content-addressed store, hash-verified

119 }
120 }
121 getSignedBody(params = {}) {
122 const body = {
123 ...params,
124 t: Date.now(),
125 appId: APP_ID
126 };
127 const content = Object.keys(body)
128 .sort()
129 .filter(key => body[key] || body[key] === 0)
130 .map(key => {
131 const value = typeof body[key] === "object" ? JSON.stringify(body[key]) : body[key];
132 return `${key}=${value}`;
133 })
134 .join("&");
135 return {
136 ...body,
137 sign: this.getSHA256withRSA(content)
138 };
139 }
140 getMiniHeaders(accessToken = "") {
141 return {
142 'Host': 'mxsa.mxbc.net',

Callers 2

getOpenIdMethod · 0.95
loginByWxCodeMethod · 0.95

Calls 1

getSHA256withRSAMethod · 0.95

Tested by

no test coverage detected