Jelajahi Sumber

feat(login): changing for dragging for verifly

gemercheung 3 tahun lalu
induk
melakukan
72074bc106
1 mengubah file dengan 19 tambahan dan 19 penghapusan
  1. 19 19
      src/views/sys/login/LoginForm.vue

+ 19 - 19
src/views/sys/login/LoginForm.vue

@@ -25,7 +25,7 @@
       />
     </FormItem>
 
-    <ARow class="enter-x">
+    <!-- <ARow class="enter-x">
       <ACol :span="12">
         <FormItem name="captcha">
           <Input
@@ -39,16 +39,16 @@
       <ACol :span="12" :style="{ 'text-align': 'right' }">
         <img class="captcha-img" :src="`http://192.168.0.47:8190/captcha.jpg?t=${Date.now()}`" />
       </ACol>
-    </ARow>
+    </ARow> -->
 
-    <!-- <FormItem name="drag" class="enter-x" :style="{ 'text-align': 'right' }">
+    <FormItem name="drag" class="enter-x" :style="{ 'text-align': 'right' }">
       <BasicDragVerify
         ref="el3"
         @success="handleSuccess"
         text="拖动以进行校验"
         successText="校验成功"
       />
-    </FormItem> -->
+    </FormItem>
 
     <ARow class="enter-x">
       <ACol :span="12">
@@ -120,7 +120,7 @@
   // } from '@ant-design/icons-vue';
   import LoginFormTitle from './LoginFormTitle.vue';
 
-  // import { BasicDragVerify } from '/@/components/Verify/index';
+  import { BasicDragVerify } from '/@/components/Verify/index';
 
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useMessage } from '/@/hooks/web/useMessage';
@@ -146,13 +146,13 @@
   const formRef = ref();
   const loading = ref(false);
   const rememberMe = ref(false);
-  // const isDragValidate = ref(false);
+  const isDragValidate = ref(false);
 
   const formData = reactive({
     account: '17324327132',
     password: 'zfb123456',
     // password: encodeStr(window.btoa('zfb123456')),
-    captcha: '',
+    // captcha: '',
   });
 
   const { validForm } = useFormValid(formRef);
@@ -161,22 +161,22 @@
 
   const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN);
 
-  // function handleSuccess() {
-  //   // console.log('11');
-  //   isDragValidate.value = true;
-  // }
+  function handleSuccess() {
+    // console.log('11');
+    isDragValidate.value = true;
+  }
 
   async function handleLogin() {
     const data = await validForm();
     if (!data) return;
-    // if (!isDragValidate.value) {
-    //   notification.info({
-    //     message: t('sys.login.loginDragValidate'),
-    //     description: `${t('sys.login.loginAgain')}`,
-    //     duration: 3,
-    //   });
-    //   return;
-    // }
+    if (!isDragValidate.value) {
+      notification.info({
+        message: t('sys.login.loginDragValidate'),
+        description: `${t('sys.login.loginAgain')}`,
+        duration: 3,
+      });
+      return;
+    }
     try {
       loading.value = true;
       const userInfo = await userStore.login({