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

Function validateToken

wxapp/aima.js:170–179  ·  view source on GitHub ↗
(account, token)

Source from the content-addressed store, hash-verified

168}
169
170async function validateToken(account, token) {
171 const res = await request("get", `${WXCLIENT_URL}/member/IndexInfo`, token, {
172 account,
173 });
174 const ok = res.status === 200 && res.data?.code === 200;
175 if (!ok) {
176 $.log(`⚠️ 缓存token失效: HTTP ${res.status} ${JSON.stringify(res.data)}`);
177 }
178 return ok;
179}
180
181async function getAccessToken(account) {
182 const value = account.trim();

Callers 1

getAccessTokenFunction · 0.85

Calls 2

requestFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected