|
@@ -5,6 +5,7 @@
|
|
|
#include "logger.h"
|
|
|
#include <QProcessEnvironment>
|
|
|
#include "loadingwidget.h"
|
|
|
+#include "global.h"
|
|
|
|
|
|
|
|
|
BlastOpePage::BlastOpePage(QWidget *parent) :
|
|
@@ -53,7 +54,7 @@ void BlastOpePage::InitFace()
|
|
|
|
|
|
Logger::getInstance().info("FaceVerification: connect");
|
|
|
// QUrl postUrl("http://192.168.1.234:8000/api/v1/h-face-verify/pc");
|
|
|
- QUrl postUrl(QString("%1/%2").arg().arg("h-face-verify/pc") );
|
|
|
+ QUrl postUrl(g_url.resolved(QUrl("h-face-verify/pc")));
|
|
|
QJsonObject response = sendPostRequest(postUrl, metaInfo);
|
|
|
QString certifyUrl;
|
|
|
if (response.contains("data") && response["data"].isObject()) {
|
|
@@ -103,10 +104,10 @@ void BlastOpePage::closeWebViewAndRestoreUI()
|
|
|
// 槽函数:处理 URL 改变事件
|
|
|
void BlastOpePage::onUrlChanged(const QUrl &newUrl) {
|
|
|
if (newUrl.scheme() == "https" && newUrl.host() == "www.baidu.com") {
|
|
|
+ LoadingWidget::showLoading(nullptr, "跳转验证页...");
|
|
|
closeWebViewAndRestoreUI();
|
|
|
QNetworkAccessManager manager;
|
|
|
- //QUrl requestUrl(QString("http://192.168.0.255:8000/api/v1/h-face-verify/certifyId/%1").arg(certifyId));
|
|
|
- QUrl requestUrl(QString("http://192.168.1.234:8000/api/v1/h-face-verify/certifyId/%1").arg(certifyId));
|
|
|
+ QUrl requestUrl(g_url.resolved(QUrl(QString("h-face-verify/certifyId/%1").arg(certifyId))));
|
|
|
QNetworkRequest request(requestUrl);
|
|
|
QNetworkReply *reply = manager.get(request);
|
|
|
QEventLoop loop;
|
|
@@ -122,6 +123,7 @@ void BlastOpePage::onUrlChanged(const QUrl &newUrl) {
|
|
|
QString message = dataObj["Message"].toString();
|
|
|
QJsonObject resultObj = dataObj["ResultObject"].toObject();
|
|
|
if (resultObj.isEmpty()) {
|
|
|
+ Logger::getInstance().error(QString( "获取认证初始化数据失败. message: %1.").arg(message));
|
|
|
int ret = QMessageBox::information(nullptr, "提示", message+" ,请重新认证!");
|
|
|
if (ret == QMessageBox::Ok) {
|
|
|
InitFace();
|
|
@@ -129,10 +131,10 @@ void BlastOpePage::onUrlChanged(const QUrl &newUrl) {
|
|
|
} else {
|
|
|
QString passed = resultObj["Passed"].toString();
|
|
|
if (passed == "T") {
|
|
|
- QMessageBox::information(nullptr, "提示", "操作成功!");
|
|
|
ui->setupUi(this);
|
|
|
initPagination();
|
|
|
-
|
|
|
+ Logger::getInstance().info(QString("进入认证界面"));
|
|
|
+ LoadingWidget::hideLoading();
|
|
|
} else if (passed == "F") {
|
|
|
int ret = QMessageBox::critical(nullptr, "提示", "操作失败,请重新认证!");
|
|
|
if (ret == QMessageBox::Ok) {
|
|
@@ -143,11 +145,11 @@ void BlastOpePage::onUrlChanged(const QUrl &newUrl) {
|
|
|
}
|
|
|
} else {
|
|
|
qDebug() << "Request failed:" << reply->errorString();
|
|
|
- Logger::getInstance().error("InitFaseVerification request failed: ");
|
|
|
- Logger::getInstance().error(reply->errorString());
|
|
|
+ Logger::getInstance().error(QString("InitFaseVerification request failed. error message: %1").arg(reply->errorString()));
|
|
|
}
|
|
|
|
|
|
reply->deleteLater();
|
|
|
+ LoadingWidget::hideLoading();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -344,16 +346,16 @@ void BlastOpePage::loadDataFromSource(int currentPage, int pageSize)
|
|
|
progressBar2->setRange(0, 100); // 设置范围为0到100
|
|
|
progressBar2->setValue(0);
|
|
|
progressBar2->setAlignment(Qt::AlignCenter);
|
|
|
- progressBar2->setStyleSheet("QProgressBar { border: 1px solid grey; border-radius: 5px; background-color: #EEEEEE; height: 20px; }"
|
|
|
- "QProgressBar::chunk { background-color: #05B8CC; width: 20px; margin: 0.5px; border - radius: 10px; }");
|
|
|
+ progressBar2->setStyleSheet("QProgressBar { border: 1px solid grey; border-radius: 5px; background-color: #EEEEEE; height: 10px; }"
|
|
|
+ "QProgressBar::chunk { background-color: #05B8CC; width: 2px; margin: 0.5px; border - radius: 10px; }");
|
|
|
progressBar2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
|
|
|
|
QProgressBar *progressBar3 = new QProgressBar(ui->tableView);
|
|
|
progressBar3->setRange(0, 100); // 设置范围为0到100
|
|
|
progressBar3->setValue(0);
|
|
|
progressBar3->setAlignment(Qt::AlignCenter);
|
|
|
- progressBar3->setStyleSheet("QProgressBar { border: 1px solid grey; border-radius: 5px; background-color: #EEEEEE; height: 20px; }"
|
|
|
- "QProgressBar::chunk { background-color: #05B8CC; width: 20px; margin: 0.5px; border - radius: 10px; }");
|
|
|
+ progressBar3->setStyleSheet("QProgressBar { border: 1px solid grey; border-radius: 5px; background-color: #EEEEEE; height: 10px; }"
|
|
|
+ "QProgressBar::chunk { background-color: #05B8CC; width: 2px; margin: 0.5px; border - radius: 10px; }");
|
|
|
progressBar3->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
|
|
|
|
progressBars.append(ProgressBarTriple(progressBar1, progressBar2,progressBar3));
|