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

Function signRequest

wxapp/roki.js:76–86  ·  view source on GitHub ↗
(timestamp)

Source from the content-addressed store, hash-verified

74}
75
76function signRequest(timestamp) {
77 const payload = {
78 aesEncryptSecret: AES_SECRET,
79 appId: ROKI_APP_ID,
80 nonce: AES_SECRET,
81 secret: SIGN_SECRET,
82 timestamp,
83 };
84 const raw = getSignString(payload);
85 return encodeURIComponent(crypto.createHmac("sha256", SIGN_SECRET).update(raw).digest("base64"));
86}
87
88function isTokenError(error) {
89 return /token|登录|授权|401|10001|unauthorized/i.test(String(error && (error.message || error)));

Callers 1

getHeadersMethod · 0.85

Calls 1

getSignStringFunction · 0.85

Tested by

no test coverage detected