You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
860 B
45 lines
860 B
#include "userdata.h"
|
|
#include "ruoyi/ruoyidatamanager.h"
|
|
|
|
UserData::UserData()
|
|
{
|
|
m_pDataManager = nullptr;
|
|
}
|
|
|
|
UserData::~UserData()
|
|
{
|
|
if(m_pDataManager)
|
|
{
|
|
delete m_pDataManager;
|
|
m_pDataManager = nullptr;
|
|
}
|
|
}
|
|
|
|
void UserData::SetManagerType(ManagerType type)
|
|
{
|
|
if(type == None)
|
|
{
|
|
m_pDataManager = new BaseDataManager;
|
|
}
|
|
else if(type == Ruoyi)
|
|
{
|
|
m_pDataManager = new RuoyiDataManager;
|
|
}
|
|
}
|
|
|
|
QPixmap UserData::GetVerificationCode()
|
|
{
|
|
if(m_pDataManager == nullptr)
|
|
return QPixmap();
|
|
else
|
|
return m_pDataManager->GetVerificationCode();
|
|
}
|
|
|
|
UserInfo UserData::Login(const QString &userName, const QString &password, const QString &code)
|
|
{
|
|
if(m_pDataManager == nullptr)
|
|
return UserInfo();
|
|
else
|
|
return m_pDataManager->Login(userName,password,code);
|
|
}
|