| | |
| | | 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(); |
| | |
| | | // 获取当前登录用户名 |
| | | 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; |
| | | |