主要功能可用

This commit is contained in:
2025-10-21 11:11:52 +08:00
parent f88b815723
commit cda1641f97
250 changed files with 245573 additions and 533279 deletions

View File

@@ -19,6 +19,7 @@ bool MySQL::open(const QString &host,
const QString &pwd,
const QString &dbName)
{
isConnectOK = false;
if (QSqlDatabase::contains("qt_mysql_conn"))
db_ = QSqlDatabase::database("qt_mysql_conn");
else
@@ -32,9 +33,11 @@ bool MySQL::open(const QString &host,
if (!db_.open()) {
qWarning() << timeStamp() << "【错误】连接失败:" << db_.lastError().text();
isConnectOK = false;
return false;
}
qInfo() << timeStamp() << "【信息】数据库连接成功";
isConnectOK = true;
return true;
}