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:
36
src/main/types/user.types.ts
Normal file
36
src/main/types/user.types.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user