Browse Source

feat(core): change login width

gemercheung 3 years ago
parent
commit
99b9ab0f85
3 changed files with 8 additions and 3 deletions
  1. 1 0
      src/locales/lang/ja/sys.ts
  2. 1 0
      src/locales/lang/zh-CN/sys.ts
  3. 6 3
      src/views/sys/login/LoginForm.vue

+ 1 - 0
src/locales/lang/ja/sys.ts

@@ -104,6 +104,7 @@ export default {
     mobile: '携帯番号',
 
     loginDragValidate: 'ログインにはドラッグアンドドロップによる確認が必要です',
+    loginDragSuccess: 'テストは成功しました!',
     loginAgain: 'もう一度やり直してください',
     captcha: '検証コード',
   },

+ 1 - 0
src/locales/lang/zh-CN/sys.ts

@@ -96,6 +96,7 @@ export default {
     mobile: '手机号码',
 
     loginDragValidate: '登录需要拖拽验证',
+    loginDragSuccess: '较验成功!',
     loginAgain: '请再次操作',
     captcha: '验证码',
   },

+ 6 - 3
src/views/sys/login/LoginForm.vue

@@ -45,8 +45,9 @@
       <BasicDragVerify
         ref="el3"
         @success="handleSuccess"
-        text="拖动以进行校验"
-        successText="校验成功"
+        :width="dragCompWidth"
+        :text="t('sys.login.loginDragValidate')"
+        :successText="t('sys.login.loginDragSuccess')"
       />
     </FormItem>
 
@@ -126,7 +127,7 @@
   import { useUserStore } from '/@/store/modules/user';
   import { LoginStateEnum, useLoginState, useFormRules, useFormValid } from './useLogin';
   import { useDesign } from '/@/hooks/web/useDesign';
-
+  import { useLocaleStore } from '/@/store/modules/locale';
   //import { onKeyStroke } from '@vueuse/core';
 
   // const ACol = Col;
@@ -134,6 +135,7 @@
   const FormItem = Form.Item;
   const InputPassword = Input.Password;
   const { t } = useI18n();
+  const localeStore = useLocaleStore();
   const { notification, createErrorModal } = useMessage();
   const { prefixCls } = useDesign('login');
   const userStore = useUserStore();
@@ -158,6 +160,7 @@
   //onKeyStroke('Enter', handleLogin);
 
   const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN);
+  const dragCompWidth = computed(() => (localeStore.getLocale === 'ja' ? '410px' : '200px'));
 
   function handleSuccess() {
     // console.log('11');