mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
实现服务端的QT应用界面
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "common/JsonN.h"
|
||||
#include "app/Application.h"
|
||||
#include "app/AppData.h"
|
||||
#include "common/Crypto.h"
|
||||
|
||||
std::string DAO::sqlPageLimit(int index, int size)
|
||||
{
|
||||
@@ -169,8 +170,6 @@ Errcode DAO::login(std::shared_ptr<DaoEntity> dao, std::string account, std::str
|
||||
if (!dao) { dao = std::make_shared<DaoEntity>(""); }
|
||||
if (!dao->isConnected())
|
||||
{
|
||||
|
||||
//DAO1::writeSystemLog(dao, 2, "", account, "用户登录失败:" + err);
|
||||
return Errcode::ERR_DB_CONN;
|
||||
}
|
||||
std::string t = Utils::timeStr();
|
||||
@@ -181,12 +180,10 @@ Errcode DAO::login(std::shared_ptr<DaoEntity> dao, std::string account, std::str
|
||||
int ret = dao->exec(sql, result);
|
||||
if (ret != 0)
|
||||
{
|
||||
//DAO1::writeSystemLog(dao, 2, "", account, "用户登录失败:" + err);
|
||||
return Errcode(ret);
|
||||
}
|
||||
if (result.size() <=0)
|
||||
{
|
||||
//DAO1::writeSystemLog(dao, 2, "", account, "用户登录失败:" + err);
|
||||
return Errcode::ERR_LOGIN_USER_NOTEXIST;
|
||||
}
|
||||
fields = result[0];
|
||||
@@ -194,9 +191,9 @@ Errcode DAO::login(std::shared_ptr<DaoEntity> dao, std::string account, std::str
|
||||
int loginCount = fields.get<int>("login_count");
|
||||
|
||||
// 判断密码
|
||||
if (passwd != fields.remove("passwd"))
|
||||
|
||||
if (passwd != Crypto::sm3(fields.remove("passwd")))
|
||||
{
|
||||
//DAO1::writeSystemLog(dao, 2, userId, account, "用户登录失败:" + err);
|
||||
return Errcode::ERR_LOGIN_PASSWD;
|
||||
}
|
||||
|
||||
@@ -571,8 +568,8 @@ Errcode DAO::queryStatStationGroup(std::shared_ptr<DaoEntity> dao, string statio
|
||||
}
|
||||
if (!category.empty() && category != "0")
|
||||
{
|
||||
if (!sqlCondition.empty()) sqlCondition += " AND ";
|
||||
sqlCondition += "category='" + category + "'";;
|
||||
//if (!sqlCondition.empty()) sqlCondition += " AND ";
|
||||
//sqlCondition += "category='" + category + "'";;
|
||||
}
|
||||
if (!sqlCondition.empty()) { sqlCondition = " WHERE " + sqlCondition; }
|
||||
|
||||
@@ -615,8 +612,8 @@ Errcode DAO::queryStatStationList(PageInfo& pageInfo, Fields& params, vector<Fie
|
||||
}
|
||||
if (!category.empty() && category != "0")
|
||||
{
|
||||
if (!sqlCondition.empty()) sqlCondition += " AND ";
|
||||
sqlCondition += "ss.category='" + category + "'";;
|
||||
//if (!sqlCondition.empty()) sqlCondition += " AND ";
|
||||
//sqlCondition += "ss.category='" + category + "'";;
|
||||
}
|
||||
if (!sqlCondition.empty()) { sqlCondition = " WHERE " + sqlCondition; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user