feat(session): add session list API

- Move token-related functions from auth.go to new session.go
- Add session tracking with expiration and cleanup
- Implement session list API endpoint
- Update login/logout handlers to use session system
- Add hourly cleanup of expired tokens and sessions
This commit is contained in:
2026-03-05 18:24:19 +08:00
parent efdaefa6f5
commit e400cc1869
6 changed files with 155 additions and 9 deletions

View File

@@ -15,6 +15,9 @@ func setupRoutes() {
http.HandleFunc("/userMgr/create", CreateUserHandler)
http.HandleFunc("/userMgr/remove", RemoveUserHandler)
http.HandleFunc("/userMgr/list", ListUserHandler)
// http.HandleFunc("/userMgr/modify", ModifyUserHandler)
http.HandleFunc("/sessionMgr/list", ListActiveSessionsHandler)
http.HandleFunc("/frpcAct/instanceMgr/create", CreateInstanceHandler)
http.HandleFunc("/frpcAct/instanceMgr/list", ListInstancesHandler)