LAPTOP-SNT8I5JK\Boounion
2024-12-02 aedb3b85fed48cb2cf0abb5fafa8e7591644c9f4
SourceCode/Bond/BondEq/DBManager/UserManager.h
@@ -22,6 +22,9 @@
    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();
@@ -38,6 +41,8 @@
    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();     // 从会话文件加载会话信息
@@ -67,12 +72,21 @@
   // 获取当前登录用户名
   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;