| | |
| | | UserManager(const UserManager&) = delete; |
| | | UserManager& operator=(const UserManager&) = delete; |
| | | |
| | | // 提供数据库连接 |
| | | std::unique_ptr<BL::Database>& getDatabaseInstance(); |
| | | |
| | | // 用户操作 |
| | | bool login(const std::string& username, const std::string& password, bool rememberMe = false); |
| | | void logout(); |
| | |
| | | bool changeUserRole(const std::string& username, UserRole newRole); |
| | | bool changeUserSessionTimeout(const std::string& username, int newTimeoutMinutes); |
| | | bool changeUserSessionExpiration(const std::string& username, int newExpirationHours); |
| | | std::vector<std::string> getUsernames(); |
| | | std::vector<std::string> getUserInfo(const std::string& username); |
| | | |
| | | // 会话文件操作 |
| | | bool loadSession(); // 从会话文件加载会话信息 |
| | |
| | | // 获取当前登录用户名 |
| | | std::string getCurrentUser() const; |
| | | |
| | | // 修改当前登录用户名 |
| | | void setCurrentUser(const std::string& strName); |
| | | |
| | | // 获取当前登录用户密码 |
| | | std::string getCurrentPass() const; |
| | | |
| | | // 修改当前登录用户密码 |
| | | void setCurrentPass(const std::string& strPass); |
| | | |
| | | // 获取当前登录用户角色 |
| | | UserRole getCurrentUserRole() const; |
| | | |
| | | // 修改当前登录用户角色 |
| | | void setCurrentUserRole(UserRole emRole); |
| | | |
| | | // 获取当前登录用户的无操作超时时间 |
| | | std::chrono::minutes getSessionTimeout() const; |
| | | |