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

Function get_token_for_account

wxapp/BREO.py:175–188  ·  view source on GitHub ↗
(account_id, index)

Source from the content-addressed store, hash-verified

173 return False
174
175def get_token_for_account(account_id, index):
176 cached = get_cached_token(account_id)
177 if cached and cached.get("token"):
178 print(f"账号 {index} 使用缓存token: {mask_token(cached['token'])}")
179 if validate_token(cached["token"]):
180 return cached["token"]
181 print(f"账号 {index} 缓存token失效,重新登录")
182 remove_cached_token(account_id)
183
184 auth_info = login_with_code(account_id)
185 save_cached_token(account_id, auth_info)
186 user_info = auth_info.get("userInfo") or {}
187 print(f"账号 {index} code登录成功: {user_info.get('nickname') or user_info.get('telephone') or auth_info.get('uid')}")
188 return auth_info["token"]
189
190def get_random_one_word():
191 try:

Callers 1

BREO.pyFile · 0.85

Calls 8

get_cached_tokenFunction · 0.85
mask_tokenFunction · 0.85
validate_tokenFunction · 0.85
remove_cached_tokenFunction · 0.85
login_with_codeFunction · 0.85
save_cached_tokenFunction · 0.85
printFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected