您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

session.ts 430B

123456789101112131415161718192021222324252627
  1. import { BaseSession } from './sessions'
  2. class SessionManager {
  3. private _current?: BaseSession
  4. clear() {
  5. this._current = undefined
  6. return this
  7. }
  8. setCurrent(session: BaseSession) {
  9. this._current = session
  10. return this
  11. }
  12. get current() {
  13. return this._current
  14. }
  15. set current(session: BaseSession) {
  16. this._current = session
  17. }
  18. }
  19. const session = new SessionManager()
  20. export default session