Browse Source

Merge branch 'feat_theme_zyh' of United_Software/k_online_ui into feat_theme

Jack Zhou 11 tháng trước cách đây
mục cha
commit
d09fea7d0e

+ 2 - 4
src/components/ContainerStatus/src/ContainerStatus.vue

@@ -114,10 +114,8 @@ watch(
     flex-direction: column;
     align-items: center;
     height: 394px;
-    img.is-dark {
-      display: block;
-      margin-top: 100px;
-    }
+    padding-top: 125px;
+
     .empty-text {
       margin-top: 8px;
       color: #b5b9bf;

BIN
src/components/ContainerStatus/src/image/no_data.png


+ 3 - 0
src/styles/theme.scss

@@ -217,6 +217,8 @@
   // 输入框禁用的颜色
   --input-disabled-bg-color: #f5f7fa;
   --input-disabled-text-color: #a8abb2;
+
+  --el-disabled-bg-color: #f4f4f4;
 }
 
 :root.dark {
@@ -311,6 +313,7 @@
   div.el-popper.is-dark {
     --el-bg-color: var(--color-neutral-1);
   }
+  --el-disabled-bg-color: rgba(244, 244, 244, 0.2);
 
   // vxe-table
   --vxe-ui-layout-background-color: #2b2f36;

+ 2 - 3
src/views/Layout/src/components/Header/HeaderView.vue

@@ -182,13 +182,13 @@ const handleLogin = () => {
           </div>
           <div class="picture-module">
             <div class="item" :class="{ active: themeStore.theme === 'light' }">
-              <img src="./images/kandroid.png" alt="" />
+              <img src="./images/light.png" alt="" />
               <div v-if="themeStore.theme === 'light'" class="selected-icon">
                 <span class="font_family icon-icon_confirm_b"></span>
               </div>
             </div>
             <div class="item" :class="{ active: themeStore.theme === 'dark' }">
-              <img src="./images/kandroid.png" alt="" />
+              <img src="./images/dark.png" alt="" />
               <div v-if="themeStore.theme === 'dark'" class="selected-icon">
                 <span class="font_family icon-icon_confirm_b"></span>
               </div>
@@ -362,7 +362,6 @@ div.el-popover.el-popper.toggle-theme-popover {
       img {
         width: 154px;
         height: 90px;
-        border-radius: 6px;
       }
       &.active {
         border: 2px solid var(--color-theme);

BIN
src/views/Layout/src/components/Header/images/dark.png


BIN
src/views/Layout/src/components/Header/images/light.png


+ 1 - 1
src/views/Login/src/components/ChangePasswordCard.vue

@@ -333,7 +333,7 @@ onUnmounted(() => {
     }
     &.is-disabled {
       :deep(.el-input__wrapper) {
-        background-color: #f4f4f4;
+        // background-color: #f4f4f4;
       }
       :deep(.el-input__inner) {
         -webkit-text-fill-color: var(--color-neutral-1);

+ 1 - 1
src/views/Login/src/components/ErrorTips.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-const dialogVisible = ref(true)
+const dialogVisible = ref(false)
 
 const openDialog = () => {
   dialogVisible.value = true

+ 20 - 7
src/views/Login/src/loginView.vue

@@ -53,6 +53,16 @@ const handleTokenRedirect = () => {
       })
       .then((res: any) => {
         handleResult(res)
+        if (res.code === 400) {
+          const { data } = res
+          if (data.msg === 'Invalid token') {
+            ElMessageBox.alert('Invalid token', 'Prompt', {
+              confirmButtonText: 'OK',
+              type: 'warning',
+              confirmButtonClass: 'el-button--dark'
+            })
+          }
+        }
       })
   }
 }
@@ -88,6 +98,8 @@ const saveCredentials = () => {
 // 验证当前用户是否存在
 const handleCheckUser = () => {
   if (!loginForm.value.username) {
+    loginError.value.username = true
+    isUserNameExit.value = false
     return
   }
   // 这里是验证用户是否存在的逻辑
@@ -221,13 +233,7 @@ const handleResult = (res: any) => {
     router.push('/')
   } else if (res.code === 400) {
     const { data } = res
-    if (data.msg === 'Invalid token') {
-      ElMessageBox.alert('Invalid token', 'Prompt', {
-        confirmButtonText: 'OK',
-        type: 'warning',
-        confirmButtonClass: 'el-button--dark'
-      })
-    } else if (data.msg === 'passwordExpires') {
+    if (data.msg === 'passwordExpires') {
       ElMessageBox.alert('Please change your password for security.', 'Prompt', {
         confirmButtonText: 'Change Password',
         type: 'warning',
@@ -259,6 +265,13 @@ const handleLoginAfterVerify = () => {
         } else {
           clearCredentials()
         }
+      } else if (res.code === 400) {
+        const { data } = res
+        if (data.msg === 'password_error') {
+          loginError.value.password = true
+        } else if (data.msg === 'error_times') {
+          errorTipsRef.value.openDialog()
+        }
       }
       handleResult(res)
     })