|
@@ -52,7 +52,6 @@ void LoginWindow::on_btnLogin_clicked() {
|
|
jsonData["password"] = password;
|
|
jsonData["password"] = password;
|
|
QJsonDocument doc(jsonData);
|
|
QJsonDocument doc(jsonData);
|
|
QByteArray data = doc.toJson();
|
|
QByteArray data = doc.toJson();
|
|
- qDebug() << "Login request data:" << apiBackendUrl;
|
|
|
|
QUrl fullUrl = apiBackendUrl.resolved(QUrl("login/pc")); // 替换为实际的服务器接口地址
|
|
QUrl fullUrl = apiBackendUrl.resolved(QUrl("login/pc")); // 替换为实际的服务器接口地址
|
|
QNetworkRequest request(fullUrl); // 替换为实际的服务器接口地址
|
|
QNetworkRequest request(fullUrl); // 替换为实际的服务器接口地址
|
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
|
@@ -105,45 +104,9 @@ void LoginWindow::on_btnLogin_clicked() {
|
|
RegistryManager::instance()->setCurentLoginUserId(userIdStr);
|
|
RegistryManager::instance()->setCurentLoginUserId(userIdStr);
|
|
QString Authority = responseObj["currentAuthority"].toString();
|
|
QString Authority = responseObj["currentAuthority"].toString();
|
|
globalAuthority = "Bearer " + Authority;
|
|
globalAuthority = "Bearer " + Authority;
|
|
|
|
+ backendAPIManager::setAuthToken(globalAuthority);
|
|
this->close();
|
|
this->close();
|
|
MainWindow *mainWindow = new MainWindow();
|
|
MainWindow *mainWindow = new MainWindow();
|
|
- backendAPIManager::setAuthToken(globalAuthority);
|
|
|
|
-
|
|
|
|
- /*TODO: delete test code
|
|
|
|
- QString jsonString =
|
|
|
|
- "{\"app_version\":\"1.52\",\"blast_latitude\":\"30."
|
|
|
|
- "21122186731856\",\"blast_longitude\":\"120.22146062951883\","
|
|
|
|
- "\"blast_time\":\"2025-06-03 "
|
|
|
|
- "12:00:00\",\"company_code\":\"3701234300003\",\"equipment_"
|
|
|
|
- "sn\":\"F34A0000001\",\"error_deto_count\":\"0\",\"operator_"
|
|
|
|
- "identity\":\"330781198509079292\",\"operator_name\":\"栋工\","
|
|
|
|
- "\"phone\":\"18611112222\",\"project_htid\":\"\",\"project_"
|
|
|
|
- "name\":\"sidf\",\"project_xmbh\":\"\",\"reg_deto_count\":"
|
|
|
|
- "\"2\",\"regs\":[{\"after_test_bus_i\":\"41\",\"after_test_bus_"
|
|
|
|
- "v\":\"8006\",\"before_blasting_i\":\"49\",\"before_blasting_"
|
|
|
|
- "v\":\"13492\",\"bus_leakage_current_i\":\"0\",\"dets\":[{"
|
|
|
|
- "\"delay_time\":\"0.0\",\"freq\":\"0\",\"in_code\":"
|
|
|
|
- "\"005AC8360A4C01A7\",\"out_code\":\"2411104F18000\","
|
|
|
|
- "\"status\":\"0x00\",\"tag\":\"1-1-1\",\"uid\":"
|
|
|
|
- "\"24211104F18000\"},{\"delay_time\":\"80.0\",\"freq\":\"0\","
|
|
|
|
- "\"in_code\":\"015AC8360A4C014E\",\"out_code\":"
|
|
|
|
- "\"2411104F18001\",\"status\":\"0x00\",\"tag\":\"1-2-1\","
|
|
|
|
- "\"uid\":\"24211104F18001\"}],\"equipment_sn\":\"null\","
|
|
|
|
- "\"equipment_version\":\"null\",\"error_deto_count\":\"0\","
|
|
|
|
- "\"net_charged_i\":\"49\",\"net_charged_v\":\"13501\",\"reg_"
|
|
|
|
- "deto_count\":\"2\"}]}";
|
|
|
|
- QJsonObject myJsonObject =
|
|
|
|
- QJsonDocument::fromJson(jsonString.toUtf8()).object();
|
|
|
|
- qDebug()
|
|
|
|
- << "debug"
|
|
|
|
- << QDateTime::fromString(myJsonObject["blast_time"].toString(),
|
|
|
|
- "yyyy-MM-dd hh:mm:ss")
|
|
|
|
- .toString(Qt::ISODateWithMs);
|
|
|
|
- int row = 1;
|
|
|
|
- firingWidget *wt = new firingWidget(row, false, "111");
|
|
|
|
- wt->testonBlastSucess(myJsonObject);
|
|
|
|
- //<< Delete
|
|
|
|
- */
|
|
|
|
|
|
|
|
QScreen *screen = QGuiApplication::primaryScreen();
|
|
QScreen *screen = QGuiApplication::primaryScreen();
|
|
QRect screenGeometry = screen->geometry();
|
|
QRect screenGeometry = screen->geometry();
|