feat: implement user authentication system

- Add SessionManager for managing user sessions (singleton pattern)
- Add BIPUsersDAO for database authentication
- Add LoginDialog component for username/password login
- Add UserSelectionDialog component for admin user selection
- Support silent login by computer name
- Implement main page with navigation to Extractor and Cleaner

Database:
- Table: dbo_BIPUsers
- Fields: UserName, Password, UserType, ComputerNmae

UI Flow:
1. Silent login on startup via computer name
2. Show login dialog if silent login fails
3. Display main page with user info and navigation
4. Support logout and re-login
This commit is contained in:
Misaka
2026-03-01 17:46:15 +08:00
parent 450eb41f96
commit 829851e3ca
12 changed files with 1671 additions and 112 deletions

View File

@@ -0,0 +1,36 @@
/**
* User types and interfaces
*/
/**
* User type enumeration
*/
export type UserType = 'Admin' | 'User' | 'Guest'
/**
* User information interface
*/
export interface UserInfo {
/** User ID */
id: number
/** Username */
username: string
/** User type */
userType: UserType
/** Create time */
createTime?: Date
}
/**
* User session interface
*/
export interface UserSession {
/** Current authenticated user */
user: UserInfo | null
/** Session token (optional for future use) */
token?: string
/** Login timestamp */
loginTime: Date
/** Whether session is active */
isActive: boolean
}