🐛 Fixing a bug. I18N 国际化KEY 重复,导致密码登录表单显示有问题

This commit is contained in:
lbw 2023-03-03 11:31:40 +08:00
parent 0052c85771
commit a3f614f67e
5 changed files with 29 additions and 31 deletions

View File

@ -10,7 +10,7 @@ export default {
one3: 'Third party login',
two4: 'Links',
},
account: {
password: {
accountPlaceholder1: 'The user name admin or not is common',
accountPlaceholder2: 'Password: 123456',
accountPlaceholder3: 'Please enter the verification code',
@ -23,11 +23,10 @@ export default {
placeholder2: 'Please enter the verification code',
codeText: 'Get code',
btnText: 'Sign in',
msgText:
'Warm tip: it is recommended to use Google, Microsoft edge, version 79.0.1072.62 and above browsers, and 360 browser, please use speed mode',
},
scan: {
text: 'Open the mobile phone to scan and quickly log in / register',
},
signInText: 'welcome back!',
browserMsgText: 'Warm tip: it is recommended to use Google, Microsoft edge, version 79.0.1072.62 and above browsers, and 360 browser, please use speed mode',
};

View File

@ -10,7 +10,7 @@ export default {
one3: '第三方登录',
two4: '友情链接',
},
account: {
password: {
accountPlaceholder1: '请输入用户名',
accountPlaceholder2: '请输入密码',
accountPlaceholder3: '请输入验证码',
@ -23,10 +23,10 @@ export default {
placeholder2: '请输入验证码',
codeText: '获取验证码',
btnText: '登 录',
msgText: '* 温馨提示建议使用谷歌、Microsoft Edge版本 79.0.1072.62 及以上浏览器360浏览器请使用极速模式',
},
scan: {
text: '打开手机扫一扫,快速登录/注册',
},
signInText: '欢迎回来!',
browserMsgText: '* 温馨提示建议使用谷歌、Microsoft Edge版本 79.0.1072.62 及以上浏览器360浏览器请使用极速模式',
};

View File

@ -133,11 +133,11 @@ export const useThemeConfig = defineStore('themeConfig', {
* /
*/
// 网站主标题菜单导航、浏览器当前网页标题、登录form顶部右侧
globalTitle: 'PigX 快速开发框架1',
globalTitle: 'PigX 快速开发框架',
// 网站副标题(登录左侧底部页顶部文字)
globalViceTitle: 'PigX 快速开发框架2',
globalViceTitle: 'PigX 快速开发框架',
// 网站副标题(登录页顶部文字)
globalViceTitleMsg: '专注、免费、开源、维护、解疑3',
globalViceTitleMsg: '专注、免费、开源、维护、解疑',
// 默认初始语言,可选值"<zh-cn|en|zh-tw>",默认 zh-cn
globalI18n: 'zh-cn',
// 默认全局组件大小,可选值"<large|'default'|small>",默认 'large'

View File

@ -1,51 +1,50 @@
<template>
<el-form size="large" class="login-content-form" ref="loginFormRef" :rules="loginRules" :model="state.ruleForm">
<el-form-item class="login-animation1">
<el-input text :placeholder="$t('account.accountPlaceholder1')" v-model="state.ruleForm.username" clearable
autocomplete="off">
<el-input text :placeholder="$t('password.accountPlaceholder1')" v-model="state.ruleForm.username" clearable
autocomplete="off">
<template #prefix>
<el-icon class="el-input__icon">
<ele-User/>
<ele-User />
</el-icon>
</template>
</el-input>
</el-form-item>
<el-form-item class="login-animation2">
<el-input :type="state.isShowPassword ? 'text' : 'password'"
:placeholder="$t('account.accountPlaceholder2')" v-model="state.ruleForm.password" autocomplete="off">
<el-input :type="state.isShowPassword ? 'text' : 'password'" :placeholder="$t('password.accountPlaceholder2')"
v-model="state.ruleForm.password" autocomplete="off">
<template #prefix>
<el-icon class="el-input__icon">
<ele-Unlock/>
<ele-Unlock />
</el-icon>
</template>
<template #suffix>
<i class="iconfont el-input__icon login-content-password"
:class="state.isShowPassword ? 'icon-yincangmima' : 'icon-xianshimima'"
@click="state.isShowPassword = !state.isShowPassword">
:class="state.isShowPassword ? 'icon-yincangmima' : 'icon-xianshimima'"
@click="state.isShowPassword = !state.isShowPassword">
</i>
</template>
</el-input>
</el-form-item>
<el-form-item>
<Verify @success="verifySuccess" :mode="'pop'" :captchaType="'blockPuzzle'"
:imgSize="{ width: '330px', height: '155px' }" ref="verifyref"/>
:imgSize="{ width: '330px', height: '155px' }" ref="verifyref" />
</el-form-item>
<el-form-item class="login-animation4">
<el-button type="primary" class="login-content-submit" round v-waves @click="handleVerify"
:loading="loading">
<span>{{ $t('account.accountBtnText') }}</span>
<el-button type="primary" class="login-content-submit" round v-waves @click="handleVerify" :loading="loading">
<span>{{ $t('password.accountBtnText') }}</span>
</el-button>
</el-form-item>
<div class="font12 mt30 login-animation4 login-msg">{{ $t('mobile.msgText') }}</div>
<div class="font12 mt30 login-animation4 login-msg">{{ $t('browserMsgText') }}</div>
</el-form>
</template>
<script setup lang="ts" name="password">
import {reactive, defineAsyncComponent, ref} from 'vue';
import {useUserInfo} from '/@/stores/userInfo';
import {useI18n} from "vue-i18n";
import { reactive, defineAsyncComponent, ref } from 'vue';
import { useUserInfo } from '/@/stores/userInfo';
import { useI18n } from "vue-i18n";
const {t} = useI18n()
const { t } = useI18n()
const Verify = defineAsyncComponent(() => import('/@/components/verifition/Verify.vue'))
//
@ -64,8 +63,8 @@ const state = reactive({
});
const loginRules = reactive({
username: [{required: true, trigger: "blur", message: t('account.accountPlaceholder1')}],
password: [{required: true, trigger: "blur", message: t('account.accountPlaceholder2')}],
username: [{ required: true, trigger: "blur", message: t('password.accountPlaceholder1') }],
password: [{ required: true, trigger: "blur", message: t('password.accountPlaceholder2') }],
})
// @ts-ignore

View File

@ -1,7 +1,7 @@
<template>
<el-form size="large" class="login-content-form" :rules="dataRules" ref="dataFormRef" :model="state.ruleForm">
<el-form-item class="login-animation1" prop="username">
<el-input text :placeholder="$t('account.accountPlaceholder1')" v-model="state.ruleForm.username" clearable
<el-input text :placeholder="$t('password.accountPlaceholder1')" v-model="state.ruleForm.username" clearable
autocomplete="off">
<template #prefix>
<el-icon class="el-input__icon">
@ -12,7 +12,7 @@
</el-form-item>
<el-form-item class="login-animation2" prop="password">
<el-input :type="state.isShowPassword ? 'text' : 'password'"
:placeholder="$t('account.accountPlaceholder2')" v-model="state.ruleForm.password" autocomplete="off">
:placeholder="$t('password.accountPlaceholder2')" v-model="state.ruleForm.password" autocomplete="off">
<template #prefix>
<el-icon class="el-input__icon">
<ele-Unlock/>
@ -27,7 +27,7 @@
</el-input>
</el-form-item>
<el-form-item class="login-animation3" prop="phone">
<el-input text :placeholder="$t('account.phonePlaceholder4')" v-model="state.ruleForm.phone" clearable
<el-input text :placeholder="$t('password.phonePlaceholder4')" v-model="state.ruleForm.phone" clearable
autocomplete="off">
<template #prefix>
<el-icon class="el-input__icon">
@ -39,7 +39,7 @@
<el-form-item class="login-animation4">
<el-button type="primary" class="login-content-submit" round v-waves @click="handleRegister"
:loading="loading">
<span>{{ $t('account.registerBtnText') }}</span>
<span>{{ $t('password.registerBtnText') }}</span>
</el-button>
</el-form-item>
</el-form>