Răsfoiți Sursa

增加不能登录的error message样式

Michael Wang 3 ani în urmă
părinte
comite
518184a517

+ 13 - 4
src/features/UserLogin/useRemoteAppChecker.ts → src/features/UserLogin/useRemoteAppChecker.tsx

@@ -89,9 +89,16 @@ export function useRemoteAppChecker() {
         .replace("wechat", "微信");
 
       names = [...new Set(names.split(",").map((v) => v.trim()))].join(",");
-      $message.info("在考试期间,请关掉" + names + "软件,诚信考试。", {
-        duration: 24 * 60 * 60 * 1000,
-      });
+      $message.info(
+        () => (
+          <div class="enhanced-error-message">
+            在考试期间,请关掉{names}软件,诚信考试。
+          </div>
+        ),
+        {
+          duration: 24 * 60 * 60 * 1000,
+        }
+      );
       logger({
         cnl: ["local", "server"],
         key: "checkRemoteAppTxt",
@@ -143,7 +150,9 @@ export function useRemoteAppChecker() {
           dtl: "unlink remoteApplication.txt 失败",
           possibleError: error,
         });
-        $message.error("系统检测出错(e-01),请退出程序后重试!");
+        $message.error("系统检测出错(e-01),请退出程序后重试!", {
+          duration: 24 * 60 * 60 * 1000,
+        });
         throw error;
       }
       await execLocal(exe);

+ 13 - 4
src/features/UserLogin/useVCamChecker.ts → src/features/UserLogin/useVCamChecker.tsx

@@ -41,9 +41,16 @@ export function useVCamChecker() {
       for (const vc of VCAM_LIST) {
         if (cameraInfo.toUpperCase().includes(vc.toUpperCase())) {
           found = true;
-          $message.info("在考试期间,请关掉虚拟摄像头软件,诚信考试。", {
-            duration: 24 * 60 * 60 * 1000,
-          });
+          $message.info(
+            () => (
+              <div class="enhanced-error-message">
+                在考试期间,请关掉虚拟摄像头软件,诚信考试。
+              </div>
+            ),
+            {
+              duration: 24 * 60 * 60 * 1000,
+            }
+          );
           logger({
             cnl: ["local", "server"],
             key: "checkVCamTxt",
@@ -89,7 +96,9 @@ export function useVCamChecker() {
           dtl: "unlink CameraInfo.txt 失败",
           possibleError: error,
         });
-        $message.error("系统检测出错(e-02),请退出程序后重试!");
+        $message.error("系统检测出错(e-02),请退出程序后重试!", {
+          duration: 24 * 60 * 60 * 1000,
+        });
         throw error;
       }
 

+ 4 - 0
src/styles/global.css

@@ -216,6 +216,10 @@ body {
   padding: 15px 20px;
 }
 
+.enhanced-error-message {
+  line-height: 80px; font-size: 36px; color: white; background-color: #D9001B;
+}
+
 /* override naiveui */
 /* 在chrome 58 消息会重叠
 https://github.com/TuSimple/naive-ui/blob/cbc2940bd84ea74782b900d2efb2d5cbadedbe1a/src/message/src/styles/index.cssr.ts#L113 */