mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-27 06:59:54 +08:00
feat: exchange oss LRU
This commit is contained in:
parent
6c4f49d85e
commit
705b4988b0
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user