feat: exchange oss LRU

This commit is contained in:
Unitwk 2024-08-29 14:57:55 +08:00
parent 6c4f49d85e
commit 705b4988b0

View File

@ -9,6 +9,9 @@ export default class UserSSOService {
if (!username || typeof username !== "string") throw new Error("username is required!");
const token = v4();
UserSSOService.tokens.set(token, username);
if (UserSSOService.tokens.size > 1000) {
UserSSOService.tokens.delete(UserSSOService.tokens.keys().next().value);
}
return token;
}