wangyaojie há 2 anos atrás
pai
commit
e87037b7a4

+ 36 - 1
client/answerWidget.cpp

@@ -197,12 +197,23 @@ answerWidget::answerWidget(QWidget *parent) :
         }
     });
 
+	if (g_appInfoPtr->m_bDisableRemoteAssistance)
+	{
+		qRegisterMetaType<CGetSoftwareConfig>("CGetSoftwareConfig");
+		connect(g_httpBllPtr.get(), &CHttpBll::sgnGetSoftwareConfig, this, &answerWidget::onGetSoftwareConfig);
+
+		CHttpRequestPackage hrp;
+		hrp.sUri = QString("https://%1/oe_client/software.json").arg(g_appInfoPtr->m_sEscDomain);
+		hrp.nRequestType = RequestType::rtGetSoftwareConfig;
+		g_httpBllPtr->getUrl(hrp);
+	}
+
 	m_pHeartbeatTimer = std::make_shared<QTimer>();
 	m_pHeartbeatTimer->setInterval(60*1000);
     connect(m_pHeartbeatTimer.get(), &QTimer::timeout, this, [&](){
 		heartBreat();
 
-		if(g_appInfoPtr->m_bFullScreenTop)
+		if(g_appInfoPtr->m_bDisableRemoteAssistance)
 		{
 			checkRemoteBreach();
 		}
@@ -221,6 +232,30 @@ answerWidget::~answerWidget()
     delete ui;
 }
 
+void answerWidget::onGetSoftwareConfig(CGetSoftwareConfig getSoftwareConfig)
+{
+	if (getSoftwareConfig.nCode == 200)
+	{
+		QString sSoftwareConfig = QByteArray::fromBase64(getSoftwareConfig.sSoftwareConfig.toLocal8Bit());
+        if(!sSoftwareConfig.isEmpty())
+        {
+            Json::Reader reader;
+            Json::Value jsonRoot = Json::Value::null;
+            if (reader.parse(sSoftwareConfig.toStdString(), jsonRoot))
+            {
+                QString sCamera = jsonRoot["vCamList"].asString().c_str();
+                QStringList cameraList = sCamera.split("\n", QString::SkipEmptyParts);
+                QString sRemoteApp = jsonRoot["remoteApp"].asString().c_str();
+                QStringList remoteAppList = sRemoteApp.split("\n", QString::SkipEmptyParts);
+
+                m_sRemoteList += remoteAppList;
+                m_sRemoteTipList += remoteAppList;
+            }
+        }
+	}
+
+}
+
 void answerWidget::checkRemoteBreach()
 {
 	

+ 1 - 0
client/answerWidget.h

@@ -46,6 +46,7 @@ private slots:
 	void onEndExam(CEndExam endExam);
     void onGetOrgPropertiesByGroupWithoutCache(CGetOrgPropertiesByGroupWithoutCache orgProperties);
     void onStartFaceLiveVerify(CStartFaceLiveVerify startFaceLiveVerify);
+	void onGetSoftwareConfig(CGetSoftwareConfig getSoftwareConfig);
 
     void on_btn_handInPaper_clicked();
 

+ 10 - 2
client/awTimeLeftTips.cpp

@@ -52,9 +52,17 @@ awTimeLeftTips::~awTimeLeftTips()
 }
 
 void awTimeLeftTips::setText(QString sTitle, QString sContent)
-{
-	ui->label_awtlt_title->setText(sTitle);
+{	
+    ui->label_awtlt_title->setText(sTitle);
+    ui->label_awtlt_title->setFixedWidth(ui->widget_awtlt_bg->width() - g_appInfoPtr->m_fRate * 20*2);
+	ui->label_awtlt_title->adjustSize();
+	ui->label_awtlt_title->setGeometry(g_appInfoPtr->m_fRate * 20, g_appInfoPtr->m_fRate * 20,
+		ui->label_awtlt_title->width(), ui->label_awtlt_title->height());
+	
 	ui->label_awtlt_content->setText(sContent);
+	ui->label_awtlt_content->adjustSize();
+	ui->label_awtlt_content->setGeometry(g_appInfoPtr->m_fRate * 40, ui->label_awtlt_title->y() + ui->label_awtlt_title->height() + g_appInfoPtr->m_fRate * 40,
+		ui->label_awtlt_content->width(), ui->label_awtlt_content->height());
 }
 
 void awTimeLeftTips::initUI()

+ 3 - 0
client/awTimeLeftTips.ui

@@ -43,6 +43,9 @@
      <property name="text">
       <string>温馨提示</string>
      </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
     </widget>
     <widget class="QLabel" name="label_awtlt_content">
      <property name="geometry">

+ 1 - 1
client/client.pro

@@ -167,7 +167,7 @@ INCLUDEPATH += ../common/ \
     ../3rdPart/TX_TRTC_SDK/Win32/include/Vod/ \
     $$BREAKPAD_PATH \
 
-LIBS +=-LC:/project/workspace/oline-exam-cloud/3rdPart/TX_TRTC_SDK/Win32/lib -lliteav \
+LIBS +=-Ld:/workspace/project/oline-exam-cloud/3rdPart/TX_TRTC_SDK/Win32/lib -lliteav \
 
 CONFIG(release, debug|release): LIBS += -L$$BREAKPAD_PATH/client/windows/Release/lib -lcommon -lcrash_generation_client -lcrash_generation_server -lexception_handler
 CONFIG(debug, debug|release): LIBS +=  -L$$BREAKPAD_PATH/client/windows/Debug/lib -lcommon -lcrash_generation_client -lcrash_generation_server -lexception_handler

+ 17 - 15
client/client.qss

@@ -9,15 +9,9 @@ QPushButton#btn_close
     border-image:url(:/images/btn-close.png);
 }
 
-QWidget#widget_loginBG
-{
-    border-radius:RATE_BASE_SIZE20px;
-}
 
-QWidget#widget_orgInfo
-{
-    border-image:url(:/images/img-login-org-info-bg.png);
-}
+
+
 
 QLabel#label_orgTitle
 {
@@ -35,11 +29,18 @@ QLabel#label_complay, #label_version
     color:rgba(255,255,255,0.7);
 }
 
-QWidget#widget_login
+QLabel#label_login_version
 {
-    background:rgba(255,255,255,1);
-    border-top-right-radius:RATE_BASE_SIZE20px;
-    border-bottom-right-radius:RATE_BASE_SIZE20px;
+    font-size:RATE_BASE_SIZE12px;
+    font-family:"Microsoft YaHei";
+    font-weight:400;
+    color:rgba(0,0,0,1);
+}
+
+QWidget#widget_loginInfo
+{
+    border-radius:RATE_BASE_SIZE10px;
+    background:rgba(0, 0, 0, 0.3);
 }
 
 QPushButton#btn_studentCodeLogin
@@ -52,6 +53,7 @@ QPushButton#btn_studentCodeLogin
     background:rgba(239,240,245,1);
     border:0px;
     text-align : center;
+    border-top-left-radius:RATE_BASE_SIZE8px;
 }
 
 QPushButton#btn_identityLogin
@@ -62,16 +64,16 @@ QPushButton#btn_identityLogin
     font-weight:400;
     color:rgba(153,153,153,1);
     background:rgba(239,240,245,1);
-    border-top-right-radius:RATE_BASE_SIZE20px;
+    border-top-right-radius:RATE_BASE_SIZE8px;
     text-align : center;
 }
 
 QLabel#label_loginTitle
 {
-    font-size:RATE_BASE_SIZE20px;
+    font-size:RATE_BASE_SIZE24px;
     font-family:"Microsoft YaHei";
     font-weight:600;
-    color:rgba(153,153,153,1);
+    color:rgba(0,0,0,1);
 }
 
 QLineEdit#edt_account

+ 4 - 2
client/courseList.cpp

@@ -980,10 +980,12 @@ void courseList::onDownLoadFile(CDownLoadFileInfo downLoadFileInfo)
     {
         if (downLoadFileInfo.nCode == 200)
         {
-            QString sFileName = g_appInfoPtr->m_sStudentPhotoPath.right(g_appInfoPtr->m_sStudentPhotoPath.length() - g_appInfoPtr->m_sStudentPhotoPath.lastIndexOf("/") - 1);
-            sFileName = g_appInfoPtr->m_sCacheFileDir + sFileName;
+//            QString sFileName = g_appInfoPtr->m_sStudentPhotoPath.right(g_appInfoPtr->m_sStudentPhotoPath.length() - g_appInfoPtr->m_sStudentPhotoPath.lastIndexOf("/") - 1);
+//            sFileName = g_appInfoPtr->m_sCacheFileDir + sFileName;
             if (downLoadFileInfo.sAdditionStr == "MenuLogoUrl")
             {
+                QString sFileName = g_appInfoPtr->m_sMenuLogoUrl.right(g_appInfoPtr->m_sMenuLogoUrl.length() - g_appInfoPtr->m_sMenuLogoUrl.lastIndexOf("/") - 1);
+                sFileName = g_appInfoPtr->m_sCacheFileDir + sFileName;
                 ui->label_cl_org_icon->setPixmap(QPixmap(sFileName).scaled(ui->label_cl_org_icon->width(), ui->label_cl_org_icon->height(),
                                                                            Qt::KeepAspectRatio, Qt::SmoothTransformation));
             }

+ 127 - 73
client/login.cpp

@@ -129,6 +129,11 @@ login::login(QWidget *parent)
 
 login::~login()
 {
+    if(g_logPtr)
+    {
+        g_logPtr.reset();
+    }
+
     awMsgBox::clear();
     delete ui;
 }
@@ -287,30 +292,34 @@ void login::initUI()
     ui->widget_BG->setGeometry(0, 0, dekwiget->width(), dekwiget->height());
     ui->btn_close->setGeometry(width() - g_appInfoPtr->m_fRate*24, 0,
                                g_appInfoPtr->m_fRate*24, g_appInfoPtr->m_fRate*24);
-	ui->label_org_logo->setGeometry(g_appInfoPtr->m_fRate * 20, g_appInfoPtr->m_fRate * 20, g_appInfoPtr->m_fRate * 80, g_appInfoPtr->m_fRate * 80);
-	ui->label_org_bg->setGeometry(0, g_appInfoPtr->m_fRate * (100+10), ui->widget_BG->width(), ui->widget_BG->height() - g_appInfoPtr->m_fRate*(100 + 10));
-	ui->widget_loginBG->setGeometry((width() - g_appInfoPtr->m_fRate*800)/2, (height() - g_appInfoPtr->m_fRate*480)/2,
-                                    g_appInfoPtr->m_fRate*800, g_appInfoPtr->m_fRate*480);
-    ui->widget_orgInfo->setGeometry(0,0, g_appInfoPtr->m_fRate*300, ui->widget_loginBG->height());
-    ui->label_orgTitle->adjustSize();
-    ui->label_orgTitle->setGeometry((ui->widget_orgInfo->width() - ui->label_orgTitle->width())/2,
-                                    g_appInfoPtr->m_fRate*42, ui->label_orgTitle->width(), ui->label_orgTitle->height());
-
-    ui->widget_login->setGeometry(ui->widget_orgInfo->width(), 0, ui->widget_loginBG->width() - ui->widget_orgInfo->width(),
-                                  ui->widget_loginBG->height());
-    ui->label_complay->adjustSize();
-    ui->label_complay->setGeometry(g_appInfoPtr->m_fRate*42, ui->widget_orgInfo->height() - g_appInfoPtr->m_fRate*42 - ui->label_complay->height(),
-                                   ui->label_complay->width(), ui->label_complay->height());
+    ui->label_org_logo->setGeometry(g_appInfoPtr->m_fRate * 80, g_appInfoPtr->m_fRate *5, g_appInfoPtr->m_fRate * 400, g_appInfoPtr->m_fRate * 100);
+    ui->label_org_bg->setGeometry(0, g_appInfoPtr->m_fRate * (100+10), ui->widget_BG->width(), ui->widget_BG->height() - g_appInfoPtr->m_fRate*(100 + 10));
+//	ui->widget_loginBG->setGeometry((width() - g_appInfoPtr->m_fRate*800)/2, (height() - g_appInfoPtr->m_fRate*480)/2,
+//                                    g_appInfoPtr->m_fRate*800, g_appInfoPtr->m_fRate*480);
+//    ui->widget_orgInfo->setGeometry(0,0, g_appInfoPtr->m_fRate*300, ui->widget_loginBG->height());
+//    ui->label_orgTitle->adjustSize();
+//    ui->label_orgTitle->setGeometry((ui->widget_orgInfo->width() - ui->label_orgTitle->width())/2,
+//                                    g_appInfoPtr->m_fRate*42, ui->label_orgTitle->width(), ui->label_orgTitle->height());
+
+
+//    ui->label_complay->adjustSize();
+//    ui->label_complay->setGeometry(g_appInfoPtr->m_fRate*42, ui->widget_orgInfo->height() - g_appInfoPtr->m_fRate*42 - ui->label_complay->height(),
+//                                   ui->label_complay->width(), ui->label_complay->height());
     if(!g_appInfoPtr->m_sVersionCode.isEmpty())
     {
-        ui->label_version->setText(QString("V%1").arg(g_appInfoPtr->m_sVersionCode));
+        ui->label_login_version->setText(QString::fromLocal8Bit("系统版本号:V%1").arg(g_appInfoPtr->m_sVersionCode));
     }
-    ui->label_version->adjustSize();
-    ui->label_version->setGeometry(ui->label_complay->x(), ui->label_complay->y() - g_appInfoPtr->m_fRate*5 - ui->label_version->height(),
-                                   ui->label_version->width(), ui->label_version->height());
 
-	ui->btn_studentCodeLogin->setGeometry(0, 0, ui->widget_login->width() / 2, g_appInfoPtr->m_fRate * 44);
-	ui->btn_identityLogin->setGeometry(ui->btn_studentCodeLogin->width(), ui->btn_studentCodeLogin->y(),
+    ui->widget_login->setGeometry(width() - g_appInfoPtr->m_fRate*(120+498), ui->label_org_bg->y() + g_appInfoPtr->m_fRate*60,
+                                  g_appInfoPtr->m_fRate*400, g_appInfoPtr->m_fRate*454);
+    ui->label_loginTitle->adjustSize();
+    ui->label_loginTitle->setGeometry((ui->widget_login->width() - ui->label_loginTitle->width())/2,
+                                      0,
+                                      ui->label_loginTitle->width(), ui->label_loginTitle->height());
+
+    ui->btn_studentCodeLogin->setGeometry(g_appInfoPtr->m_fRate*40, ui->label_loginTitle->y() + ui->label_loginTitle->height() + g_appInfoPtr->m_fRate*30,
+                                          (ui->widget_login->width() -g_appInfoPtr->m_fRate*40*2) / 2, g_appInfoPtr->m_fRate * 44);
+    ui->btn_identityLogin->setGeometry(ui->btn_studentCodeLogin->x() + ui->btn_studentCodeLogin->width(), ui->btn_studentCodeLogin->y(),
 		ui->btn_studentCodeLogin->width(), ui->btn_studentCodeLogin->height());
 	if (m_loginType == LOGIN_TYPE::lt_identity)
 	{
@@ -322,28 +331,32 @@ void login::initUI()
     {
         if(m_loginType == LOGIN_TYPE::lt_studentCode)
         {
-            ui->btn_studentCodeLogin->setGeometry(0, 0, ui->widget_login->width(), g_appInfoPtr->m_fRate * 44);
+            ui->btn_studentCodeLogin->setGeometry(g_appInfoPtr->m_fRate*40, ui->label_loginTitle->y() + ui->label_loginTitle->height() + g_appInfoPtr->m_fRate*30, ui->widget_login->width() - g_appInfoPtr->m_fRate*40*2, g_appInfoPtr->m_fRate * 44);
         }
 
         if(m_loginType == LOGIN_TYPE::lt_identity)
         {
-            ui->btn_identityLogin->setGeometry(0, 0, ui->widget_login->width(), g_appInfoPtr->m_fRate * 44);
+            ui->btn_identityLogin->setGeometry(g_appInfoPtr->m_fRate*40, ui->label_loginTitle->y() + ui->label_loginTitle->height() + g_appInfoPtr->m_fRate*30, ui->widget_login->width() - g_appInfoPtr->m_fRate*40*2, g_appInfoPtr->m_fRate * 44);
         }
     }
 	
-    ui->label_loginTitle->adjustSize();
-    ui->label_loginTitle->setGeometry((ui->widget_login->width() - ui->label_loginTitle->width())/2,
-                                      ui->btn_studentCodeLogin->y() + ui->btn_studentCodeLogin->height() + g_appInfoPtr->m_fRate*50,
-                                      ui->label_loginTitle->width(), ui->label_loginTitle->height());
-    ui->edt_account->setGeometry((ui->widget_login->width() - g_appInfoPtr->m_fRate*300)/2,
-                                 ui->label_loginTitle->y() + ui->label_loginTitle->height() + g_appInfoPtr->m_fRate*50,
-                                 g_appInfoPtr->m_fRate*300, g_appInfoPtr->m_fRate*40);
+    ui->widget_loginInfo->setGeometry(0, ui->btn_studentCodeLogin->y() + ui->btn_studentCodeLogin->height(),
+                                      ui->widget_login->width(), ui->widget_login->height() - ui->btn_studentCodeLogin->y() - ui->btn_studentCodeLogin->height());
+
+    ui->edt_account->setGeometry((ui->widget_loginInfo->width() - g_appInfoPtr->m_fRate*280)/2,
+                                 g_appInfoPtr->m_fRate*70,
+                                 g_appInfoPtr->m_fRate*280, g_appInfoPtr->m_fRate*50);
 
 
-    ui->edt_password->setGeometry(ui->edt_account->x(), ui->edt_account->y() + ui->edt_account->height() + g_appInfoPtr->m_fRate*30,
+    ui->edt_password->setGeometry(ui->edt_account->x(), ui->edt_account->y() + ui->edt_account->height() + g_appInfoPtr->m_fRate*20,
                                   ui->edt_account->width(), ui->edt_account->height());
     ui->btn_login->setGeometry(ui->edt_account->x(), ui->edt_password->y() + ui->edt_password->height() + g_appInfoPtr->m_fRate*40,
-                               ui->edt_account->width(), g_appInfoPtr->m_fRate*44);
+                               ui->edt_account->width(), g_appInfoPtr->m_fRate*56);
+    ui->label_login_version->adjustSize();
+    ui->label_login_version->setGeometry(ui->widget_login->x() + (ui->widget_login->width() - ui->label_login_version->width())/2,
+                                   ui->widget_BG->height() - g_appInfoPtr->m_fRate*40 - ui->label_login_version->height(),
+                                   ui->label_login_version->width(), ui->label_login_version->height());
+
 	ui->widget_BG->setVisible(true);
 	setBtnStyle();
 	
@@ -352,53 +365,94 @@ void login::initUI()
 
 void login::setBtnStyle()
 {
-    if(m_loginType == LOGIN_TYPE::lt_studentCode)
+    if(m_nloginTypeCount < 2)
     {
-        ui->btn_studentCodeLogin->setStyleSheet(QString(R"(QPushButton
-                                                        {
-                                                            outline:none;
-                                                            font-size:%1px;
-                                                            font-family:"Microsoft YaHei";
-                                                            font-weight:400;
-                                                            color:rgba(19,187,138,1);
-                                                            background:rgba(255,255,255,1);
-                                                            border:0px;
-                                                        })").arg((int)(g_appInfoPtr->m_fRate*14)));
-        ui->btn_identityLogin->setStyleSheet(QString(R"(QPushButton
-                                                     {
-                                                         outline:none;
-                                                         font-size:%1px;
-                                                         font-family:"Microsoft YaHei";
-                                                         font-weight:400;
-                                                         color:rgba(153,153,153,1);
-                                                         background:rgba(239,240,245,1);
-                                                         border-top-right-radius:%2px;
-                                                     })").arg((int)(g_appInfoPtr->m_fRate*14)).arg((int)(g_appInfoPtr->m_fRate*20)));
+        if(m_loginType == LOGIN_TYPE::lt_studentCode)
+        {
+            ui->btn_studentCodeLogin->setStyleSheet(QString(R"(QPushButton
+                                                            {
+                                                                outline:none;
+                                                                font-size:%1px;
+                                                                font-family:"Microsoft YaHei";
+                                                                font-weight:400;
+                                                                color:rgba(19,187,138,1);
+                                                                background:rgba(255,255,255,1);
+                                                                border:0px;
+                                                                border-top-left-radius:%2;
+                                                                border-top-right-radius:%3px;
+                                                            })").arg((int)(g_appInfoPtr->m_fRate*14)).arg((int)(g_appInfoPtr->m_fRate*8)).arg((int)(g_appInfoPtr->m_fRate*8)));
+        }
+        else
+        {
+            ui->btn_identityLogin->setStyleSheet(QString(R"(QPushButton
+                                             {
+                                                 outline:none;
+                                                 font-size:%1px;
+                                                 font-family:"Microsoft YaHei";
+                                                 font-weight:400;
+                                                 color:rgba(19,187,138,1);
+                                                 background:rgba(255,255,255,1);
+                                                 border-top-left-radius:%2;
+                                                 border-top-right-radius:%3px;
+                                             })").arg((int)(g_appInfoPtr->m_fRate*14))
+                                            .arg((int)(g_appInfoPtr->m_fRate*8))
+                                            .arg((int)( g_appInfoPtr->m_fRate*8 )));
+        }
     }
     else
     {
-        ui->btn_studentCodeLogin->setStyleSheet(QString(R"(QPushButton
-                                                        {
-                                                            outline:none;
-                                                            font-size:%1px;
-                                                            font-family:"Microsoft YaHei";
-                                                            font-weight:400;
-                                                            color:rgba(153,153,153,1);
-                                                            background:rgba(239,240,245,1);
-                                                            border:0px;
-                                                        })").arg((int)(g_appInfoPtr->m_fRate*14)));       
-		ui->btn_identityLogin->setStyleSheet(QString(R"(QPushButton
-                                                     {
-                                                         outline:none;
-                                                         font-size:%1px;
-                                                         font-family:"Microsoft YaHei";
-                                                         font-weight:400;
-                                                         color:rgba(19,187,138,1);
-                                                         background:rgba(255,255,255,1);
-                                                         border-top-right-radius:%2px;
-                                                     })").arg((int)(g_appInfoPtr->m_fRate*14))
-													.arg((int)(ui->btn_studentCodeLogin->isVisible() ? g_appInfoPtr->m_fRate*20 : 0)));
+        if(m_loginType == LOGIN_TYPE::lt_studentCode)
+        {
+            ui->btn_studentCodeLogin->setStyleSheet(QString(R"(QPushButton
+                                                            {
+                                                                outline:none;
+                                                                font-size:%1px;
+                                                                font-family:"Microsoft YaHei";
+                                                                font-weight:400;
+                                                                color:rgba(255,255,255,1);
+                                                                background:rgba(19,187,138,1);
+                                                                border:0px;
+                                                                border-top-left-radius:%2px;
+                                                            })").arg((int)(g_appInfoPtr->m_fRate*14)).arg((int)(g_appInfoPtr->m_fRate*8)));
+            ui->btn_identityLogin->setStyleSheet(QString(R"(QPushButton
+                                                         {
+                                                             outline:none;
+                                                             font-size:%1px;
+                                                             font-family:"Microsoft YaHei";
+                                                             font-weight:400;
+                                                             color:rgba(32,32,32,1);
+                                                             background:rgba(239,240,245,1);
+                                                             border-top-right-radius:%2px;
+                                                         })").arg((int)(g_appInfoPtr->m_fRate*14)).arg((int)(g_appInfoPtr->m_fRate*8)));
+        }
+        else
+        {
+            ui->btn_studentCodeLogin->setStyleSheet(QString(R"(QPushButton
+                                                            {
+                                                                outline:none;
+                                                                font-size:%1px;
+                                                                font-family:"Microsoft YaHei";
+                                                                font-weight:400;
+                                                                color:rgba(153,153,153,1);
+                                                                background:rgba(239,240,245,1);
+                                                                border:0px;
+                                                                border-top-left-radius:%2px;
+                                                            })").arg((int)(g_appInfoPtr->m_fRate*14)).arg((int)(g_appInfoPtr->m_fRate*8)));
+            ui->btn_identityLogin->setStyleSheet(QString(R"(QPushButton
+                                                         {
+                                                             outline:none;
+                                                             font-size:%1px;
+                                                             font-family:"Microsoft YaHei";
+                                                             font-weight:400;
+                                                             color:rgba(255,255,255,1);
+                                                             background:rgba(19,187,138,1);
+                                                             border-top-right-radius:%2px;
+                                                         })").arg((int)(g_appInfoPtr->m_fRate*14))
+                                                        .arg((int)(ui->btn_studentCodeLogin->isVisible() ? g_appInfoPtr->m_fRate*8 : 0)));
+        }
     }
+
+
 }
 
 void login::on_btn_close_clicked()

+ 69 - 105
client/login.ui

@@ -64,120 +64,84 @@
      <string/>
     </property>
    </widget>
-   <widget class="QWidget" name="widget_loginBG" native="true">
+   <widget class="QWidget" name="widget_login" native="true">
     <property name="geometry">
      <rect>
-      <x>150</x>
-      <y>150</y>
-      <width>481</width>
+      <x>350</x>
+      <y>120</y>
+      <width>311</width>
       <height>361</height>
      </rect>
     </property>
-    <widget class="QWidget" name="widget_orgInfo" native="true">
+    <widget class="QPushButton" name="btn_studentCodeLogin">
      <property name="geometry">
       <rect>
-       <x>0</x>
-       <y>0</y>
-       <width>171</width>
-       <height>361</height>
+       <x>10</x>
+       <y>60</y>
+       <width>151</width>
+       <height>41</height>
       </rect>
      </property>
-     <widget class="QLabel" name="label_orgTitle">
-      <property name="geometry">
-       <rect>
-        <x>30</x>
-        <y>40</y>
-        <width>111</width>
-        <height>16</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>网考学生端</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_version">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>298</y>
-        <width>54</width>
-        <height>12</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>V1.0</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_complay">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>320</y>
-        <width>551</width>
-        <height>20</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>武汉启明泰和软件服务有限公司技术支持</string>
-      </property>
-     </widget>
+     <property name="text">
+      <string>学号登录</string>
+     </property>
     </widget>
-    <widget class="QWidget" name="widget_login" native="true">
+    <widget class="QPushButton" name="btn_identityLogin">
      <property name="geometry">
       <rect>
-       <x>170</x>
-       <y>0</y>
-       <width>311</width>
-       <height>361</height>
+       <x>160</x>
+       <y>60</y>
+       <width>161</width>
+       <height>41</height>
       </rect>
      </property>
-     <widget class="QPushButton" name="btn_studentCodeLogin">
-      <property name="geometry">
-       <rect>
-        <x>0</x>
-        <y>0</y>
-        <width>151</width>
-        <height>41</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>学号登录</string>
-      </property>
-     </widget>
-     <widget class="QPushButton" name="btn_identityLogin">
-      <property name="geometry">
-       <rect>
-        <x>150</x>
-        <y>0</y>
-        <width>161</width>
-        <height>41</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>身份证号登录</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_loginTitle">
+     <property name="text">
+      <string>身份证号登录</string>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_loginTitle">
+     <property name="geometry">
+      <rect>
+       <x>120</x>
+       <y>20</y>
+       <width>81</width>
+       <height>16</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>在线考试平台</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+    <widget class="QWidget" name="widget_loginInfo" native="true">
+     <property name="geometry">
+      <rect>
+       <x>30</x>
+       <y>100</y>
+       <width>271</width>
+       <height>191</height>
+      </rect>
+     </property>
+     <widget class="QPushButton" name="btn_login">
       <property name="geometry">
        <rect>
-        <x>130</x>
-        <y>90</y>
-        <width>81</width>
-        <height>16</height>
+        <x>40</x>
+        <y>130</y>
+        <width>221</width>
+        <height>21</height>
        </rect>
       </property>
       <property name="text">
-       <string>在线考试平台</string>
-      </property>
-      <property name="wordWrap">
-       <bool>true</bool>
+       <string>登录</string>
       </property>
      </widget>
      <widget class="QLineEdit" name="edt_account">
       <property name="geometry">
        <rect>
-        <x>50</x>
-        <y>140</y>
+        <x>40</x>
+        <y>20</y>
         <width>221</width>
         <height>20</height>
        </rect>
@@ -189,8 +153,8 @@
      <widget class="QLineEdit" name="edt_password">
       <property name="geometry">
        <rect>
-        <x>50</x>
-        <y>190</y>
+        <x>40</x>
+        <y>70</y>
         <width>221</width>
         <height>20</height>
        </rect>
@@ -202,21 +166,21 @@
        <string>请输入用密码</string>
       </property>
      </widget>
-     <widget class="QPushButton" name="btn_login">
-      <property name="geometry">
-       <rect>
-        <x>50</x>
-        <y>250</y>
-        <width>221</width>
-        <height>21</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>登录</string>
-      </property>
-     </widget>
     </widget>
    </widget>
+   <widget class="QLabel" name="label_login_version">
+    <property name="geometry">
+     <rect>
+      <x>570</x>
+      <y>570</y>
+      <width>45</width>
+      <height>10</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>v1.0.0</string>
+    </property>
+   </widget>
   </widget>
  </widget>
  <resources/>

+ 8 - 3
client/main.cpp

@@ -120,8 +120,8 @@ int main(int argc, char *argv[])
 //	printf("9/3=%d\n", mydiv(9, 3));
 	//printf("9/0=%d\n", mydiv(9, 0));  //程序将在此崩溃
 	
-	login w;
-	w.show();
+    login w;
+    w.show();
 
 	if (argc > 1)
 	{
@@ -151,7 +151,12 @@ int main(int argc, char *argv[])
 	}
 	else
 	{
+
+#ifdef _DEBUG
         return a.exec();
-		//return 0;
+#else
+        return 0;
+#endif
 	}
 }
+

+ 1 - 1
common/CAppInfo.h

@@ -125,7 +125,7 @@ public:
     bool m_bShowDebugInfo;//是否显示debug日志
     __int64 serverMTime();
 
-    std::map<QString, QString> m_FileCacheMap;
+    std::map<QString, QString> m_FileCacheMap ;
 };
 
 extern std::shared_ptr<CAppInfo> g_appInfoPtr;

+ 4 - 1
common/CHttpBll.cpp

@@ -1203,7 +1203,10 @@ void CHttpBll::genSysNotice(CSysNotice *pSysNotice, const std::string &sResponse
 
 void CHttpBll::genSoftwareConfig(CGetSoftwareConfig *pSoftwareConfig, const std::string &sResponse)
 {
-    pSoftwareConfig->sSoftwareConfig = std::string(sResponse.rbegin()+32, sResponse.rend()).c_str();
+    if(!sResponse.empty())
+    {
+        pSoftwareConfig->sSoftwareConfig = std::string(sResponse.rbegin()+32, sResponse.rend()).c_str();
+    }
 }
 
 void CHttpBll::genLoginLimit(CLoginLimit *pLoginLimit, const std::string &sResponse)

+ 11 - 6
common/CLogTrack.cpp

@@ -11,7 +11,7 @@ CLogData::CLogData()
 
 CLogData::~CLogData()
 {
-
+    m_LogList.clear();
 }
 
 QString CLogData::genLogJson()
@@ -19,8 +19,8 @@ QString CLogData::genLogJson()
     Json::Value jLog;
     jLog[LOG_CONSTANT_DEF::SOURCE] = LOG_CONSTANT_DEF::WIN;
     Json::Value item;
-    for_each(m_LogMap.begin(), m_LogMap.end(), [&](std::map<QString, QString>::value_type v){
-        item[v.first.toStdString()] = v.second.toStdString();
+    for_each(m_LogList.begin(), m_LogList.end(), [&](CLogInfo v){
+        item[v.sKey.toStdString()] = v.sValue.toStdString();
     });
     jLog[LOG_CONSTANT_DEF::LOGS].append(item);
     return  Json::FastWriter().write(jLog).c_str();
@@ -28,7 +28,10 @@ QString CLogData::genLogJson()
 
 void CLogData::pushLog(QString sKey, QString sValue)
 {
-    m_LogMap.insert(std::pair<QString, QString>(sKey, sValue));
+    CLogInfo li;
+    li.sKey = sKey;
+    li.sValue = sValue;
+    m_LogList.push_back(li);
 }
 
 CLogTrack::CLogTrack(QString sProjectName, QString sEndpoint, QString sLogstore)
@@ -40,6 +43,8 @@ CLogTrack::CLogTrack(QString sProjectName, QString sEndpoint, QString sLogstore)
 
 CLogTrack::~CLogTrack()
 {
+    std::scoped_lock lock(m_logMutex);
+    m_LogList.clear();
     m_bIsRun = false;
     m_thread.join();
 }
@@ -72,8 +77,8 @@ void CLogTrack::threadProc()
             {
                 if(nCode == 200)//成功
                 {
-                    OC oc;
-                    emit logFaild(oc);
+//                    OC oc;
+//                    emit logFaild(oc);
                 }
             }
             else

+ 32 - 20
common/CLogTrack.h

@@ -28,6 +28,18 @@ struct OC
     int a;
 };
 
+class CLogInfo
+{
+public:
+    QString sKey;
+    QString sValue;
+    CLogInfo()
+    {
+        sKey = "";
+        sValue = "";
+    }
+};
+
 class CLogData
 {
 public:
@@ -36,7 +48,7 @@ public:
     QString genLogJson();
     void pushLog(QString sKey, QString sValue);
 private:
-    std::map<QString, QString> m_LogMap;
+    std::vector<CLogInfo> m_LogList;
 };
 
 class CLogTrack : public QObject
@@ -49,7 +61,7 @@ public:
 
     void putLog(CLogData log);
 signals:
-    void logFaild(OC oc);
+   // void logFaild(OC oc);
 private:
     void threadProc();
 
@@ -66,24 +78,24 @@ private:
 
 extern std::shared_ptr<CLogTrack> g_logPtr;
 
-class base : public QWidget
-{
-    Q_OBJECT
-public:
-    base(QWidget *parent = nullptr) : QWidget(parent)
-    {
-        qRegisterMetaType<OC>("OC");
-        connect(g_logPtr.get(), &CLogTrack::logFaild, this, &base::logFaild);
-    }
-private slots:
-    virtual void logFaild(OC oc)
-    {
-        std::call_once(*oc.oc.get(), []() {
-
-        });
-    }
-
-};
+//class base : public QWidget
+//{
+//    Q_OBJECT
+//public:
+//    base(QWidget *parent = nullptr) : QWidget(parent)
+//    {
+//        qRegisterMetaType<OC>("OC");
+//        connect(g_logPtr.get(), &CLogTrack::logFaild, this, &base::logFaild);
+//    }
+//private slots:
+//    virtual void logFaild(OC oc)
+//    {
+//        std::call_once(*oc.oc.get(), []() {
+
+//        });
+//    }
+
+//};
 
 
 

+ 13 - 10
common/httpDataDef.h

@@ -733,7 +733,7 @@ public:
 		QStringList weekList;
 		for (int nWeek : vWeek)
 		{
-			weekList << mWeekCycle.at(nWeek);
+            weekList << mWeekCycle.at(nWeek-1);
 		}
 		return weekList.join(QString::fromLocal8Bit(","));
 	}
@@ -757,17 +757,20 @@ public:
 		return bRet;
 	}
 private:
-	inline static const std::map<int, QString> mWeekCycle = {
-		{1, QString::fromLocal8Bit("周一")},
-		{2, QString::fromLocal8Bit("周二")},
-		{3, QString::fromLocal8Bit("周三")},
-		{4, QString::fromLocal8Bit("周四")},
-		{5, QString::fromLocal8Bit("周五")},
-		{6, QString::fromLocal8Bit("周六")},
-		{7, QString::fromLocal8Bit("周日")},
-	};
+
+    inline static std::vector<QString> mWeekCycle = {
+            QString::fromLocal8Bit("周一"),
+            QString::fromLocal8Bit("周二"),
+            QString::fromLocal8Bit("周三"),
+            QString::fromLocal8Bit("周四"),
+            QString::fromLocal8Bit("周五"),
+            QString::fromLocal8Bit("周六"),
+            QString::fromLocal8Bit("周日"),
+        };
 };
 
+
+
 class CExamCourseInfo
 {
 public:

+ 5 - 3
common/popMsgBox.cpp

@@ -32,16 +32,18 @@ void popMsgBox::initUI(POP_MSG_BTN btn)
 {
     int nCW = g_appInfoPtr->m_fRate*340;
     QDesktopWidget *dekwiget = QApplication::desktop();
-    setGeometry((dekwiget->width() - nCW)/2, (dekwiget->height() - g_appInfoPtr->m_fRate*203)/2, nCW, g_appInfoPtr->m_fRate*203);
-    ui->widget_pmb_bg->setGeometry(0, 0 , nCW, g_appInfoPtr->m_fRate*203);
+    setGeometry((dekwiget->width() - nCW)/2, (dekwiget->height() - g_appInfoPtr->m_fRate*253)/2, nCW, g_appInfoPtr->m_fRate*253);
+    ui->widget_pmb_bg->setGeometry(0, 0 , nCW, g_appInfoPtr->m_fRate*253);
     ui->label_pmb_icon->setGeometry(g_appInfoPtr->m_fRate*30, g_appInfoPtr->m_fRate*30,
                                    g_appInfoPtr->m_fRate*40, g_appInfoPtr->m_fRate*40);
     ui->label_pmb_title->adjustSize();
     ui->label_pmb_title->setGeometry(ui->label_pmb_icon->x() + ui->label_pmb_icon->width() + g_appInfoPtr->m_fRate*16, g_appInfoPtr->m_fRate*30,
                                      ui->label_pmb_title->width(), ui->label_pmb_title->height());
+    ui->label_pmb_content->setFixedWidth(nCW - ui->label_pmb_icon->x() - ui->label_pmb_icon->width() - g_appInfoPtr->m_fRate*16*2);\
+    ui->label_pmb_content->adjustSize();
     ui->label_pmb_content->setGeometry(ui->label_pmb_icon->x() + ui->label_pmb_icon->width() + g_appInfoPtr->m_fRate*16,
                                        ui->label_pmb_title->y() + ui->label_pmb_title->height() + g_appInfoPtr->m_fRate*8,
-                                   224, 80);
+                                   ui->label_pmb_content->width(), ui->label_pmb_content->height());
 	if (btn == POP_MSG_BTN::pmb_yes)
 	{
 		ui->btn_no->setVisible(false);

+ 3 - 0
common/popMsgBox.ui

@@ -63,6 +63,9 @@
     <property name="alignment">
      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
     </property>
+    <property name="wordWrap">
+     <bool>true</bool>
+    </property>
    </widget>
    <widget class="QPushButton" name="btn_no">
     <property name="geometry">

+ 14 - 13
launcher/envCheck.cpp

@@ -115,9 +115,7 @@ void envCheck::onStudentClientConfig(CStudentClientConfig studentClientConfig)
         return;
     }
 
-    #ifdef _DEBUG
-    g_appInfoPtr->m_bDisableRemoteAssistance = false;
-#endif
+
 
     if(g_appInfoPtr->m_bDisableRemoteAssistance || g_appInfoPtr->m_bDisableVirtualCamera)
     {
@@ -138,19 +136,22 @@ void envCheck::onGetSoftwareConfig(CGetSoftwareConfig getSoftwareConfig)
     {
         qDebug()<<getSoftwareConfig.sSoftwareConfig.toLocal8Bit();
         QString sSoftwareConfig = QByteArray::fromBase64(getSoftwareConfig.sSoftwareConfig.toLocal8Bit());
-        Json::Reader reader;
-        Json::Value jsonRoot = Json::Value::null;
-        if (reader.parse(sSoftwareConfig.toStdString(), jsonRoot))
+        if(!sSoftwareConfig.isEmpty())
         {
-            QString sCamera = jsonRoot["vCamList"].asString().c_str();
-            QStringList cameraList = sCamera.split("\n", QString::SkipEmptyParts);
-            QString sRemoteApp = jsonRoot["remoteApp"].asString().c_str();
-            QStringList remoteAppList = sRemoteApp.split("\n", QString::SkipEmptyParts);
+            Json::Reader reader;
+            Json::Value jsonRoot = Json::Value::null;
+            if (reader.parse(sSoftwareConfig.toStdString(), jsonRoot))
+            {
+                QString sCamera = jsonRoot["vCamList"].asString().c_str();
+                QStringList cameraList = sCamera.split("\n", QString::SkipEmptyParts);
+                QString sRemoteApp = jsonRoot["remoteApp"].asString().c_str();
+                QStringList remoteAppList = sRemoteApp.split("\n", QString::SkipEmptyParts);
 
-            m_sCameraList += cameraList;
+                m_sCameraList += cameraList;
 
-            m_sRemoteList += remoteAppList;
-            m_sRemoteTipList += remoteAppList;
+                m_sRemoteList += remoteAppList;
+                m_sRemoteTipList += remoteAppList;
+            }
         }
     }