|
@@ -50,7 +50,7 @@ void BlastOpePage::showCountDownWidget(QString uuid, const QString &topic, const
|
|
|
void BlastOpePage::InitFace() {
|
|
|
Logger::getInstance().info("start init face verification");
|
|
|
LoadingWidget::showLoading(this, "请求创建人脸识别...");
|
|
|
-
|
|
|
+ closeWebViewAndRestoreUI();
|
|
|
layout = new QVBoxLayout(this);
|
|
|
// TODO: relase the qwebengineview when not successfully verified
|
|
|
view = new QWebEngineView(this);
|
|
@@ -124,7 +124,6 @@ void BlastOpePage::closeWebViewAndRestoreUI() {
|
|
|
void BlastOpePage::onUrlChanged(const QUrl &newUrl) {
|
|
|
LoadingWidget::showLoading(this, "查询验证结果...");
|
|
|
if (newUrl.host() == "www.integrateblaster.com") {
|
|
|
- closeWebViewAndRestoreUI();
|
|
|
QNetworkAccessManager manager;
|
|
|
QUrl requestUrl(apiBackendUrl.resolved(QUrl(QString("h-face-verify/certifyId/%1").arg(certifyId))));
|
|
|
QNetworkRequest request(requestUrl);
|
|
@@ -146,6 +145,7 @@ void BlastOpePage::onUrlChanged(const QUrl &newUrl) {
|
|
|
int ret = QMessageBox::information(nullptr, "认证失败", message + " ,请重新认证!");
|
|
|
if (ret == QMessageBox::Ok) {
|
|
|
InitFace();
|
|
|
+ return;
|
|
|
}
|
|
|
} else {
|
|
|
QString passed = resultObj["Passed"].toString();
|
|
@@ -158,6 +158,7 @@ void BlastOpePage::onUrlChanged(const QUrl &newUrl) {
|
|
|
int ret = QMessageBox::critical(nullptr, "提示", "操作失败,请重新认证!");
|
|
|
if (ret == QMessageBox::Ok) {
|
|
|
InitFace();
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -171,19 +172,11 @@ void BlastOpePage::onUrlChanged(const QUrl &newUrl) {
|
|
|
reply->deleteLater();
|
|
|
LoadingWidget::hideLoading();
|
|
|
}
|
|
|
+ closeWebViewAndRestoreUI();
|
|
|
LoadingWidget::hideLoading();
|
|
|
}
|
|
|
|
|
|
-BlastOpePage::~BlastOpePage() {
|
|
|
- delete ui;
|
|
|
-
|
|
|
- if (view) {
|
|
|
- delete view;
|
|
|
- }
|
|
|
- if (layout) {
|
|
|
- delete layout;
|
|
|
- }
|
|
|
-}
|
|
|
+BlastOpePage::~BlastOpePage() { delete ui; }
|
|
|
|
|
|
QJsonObject BlastOpePage::sendPostRequest(const QUrl &url, const QJsonObject &data) {
|
|
|
QNetworkAccessManager manager;
|