style: error页面多语言

This commit is contained in:
TsMask
2023-11-10 14:15:14 +08:00
parent be4e1b1d09
commit 04a7b3887f
4 changed files with 56 additions and 11 deletions

View File

@@ -122,6 +122,22 @@ export default {
serialNum: 'serialNum', serialNum: 'serialNum',
expiryDate: 'expiryDate', expiryDate: 'expiryDate',
}, },
error: {
err403: {
ttile: 'No access',
subTitle:'Please do not perform illegal operations, you can go back to the main page or return to the',
backHome: 'Back to Home',
back: 'Back',
},
err404: {
ttile: 'Match page not found',
subTitle:'Sorry, the page you are looking for does not exist.',
backHome: 'Back to Home',
tipTitle: "Can't find the page?",
paragraph: 'Try checking the URL for errors and then press the refresh button on your browser.',
paragraph1: 'Try to find other content in our application.',
},
},
login: { login: {
tabPane1: 'Account password login', tabPane1: 'Account password login',
tabPane2: 'Login with phone number', tabPane2: 'Login with phone number',

View File

@@ -122,6 +122,22 @@ export default {
serialNum: '序列号', serialNum: '序列号',
expiryDate: '许可证到期日期', expiryDate: '许可证到期日期',
}, },
error: {
err403: {
ttile: '没有访问权限',
subTitle:'请不要进行非法操作,您可以返回主页面或返回',
backHome: '返回首页',
back: '返回',
},
err404: {
ttile: '找不到匹配页面',
subTitle:'对不起,您正在寻找的页面不存在。',
backHome: '返回首页',
tipTitle: '找不到网页?',
paragraph: '尝试检查URL的错误然后按浏览器上的刷新按钮。',
paragraph1: '尝试在我们的应用程序中找到其他内容。',
},
},
login: { login: {
tabPane1: '账号密码登录', tabPane1: '账号密码登录',
tabPane2: '手机号登录', tabPane2: '手机号登录',

View File

@@ -1,19 +1,25 @@
<script setup lang="ts"> <script setup lang="ts">
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import useI18n from '@/hooks/useI18n';
const router = useRouter(); const router = useRouter();
const { t } = useI18n();
</script> </script>
<template> <template>
<a-result <a-result
status="403" status="403"
title="没有访问权限" :title="t('views.error.err403.ttile')"
sub-title="请不要进行非法操作您可以返回主页面或返回" :sub-title="t('views.error.err403.subTitle')"
> >
<template #extra> <template #extra>
<RouterLink :to="{ name: 'Index' }" :replace="true"> <RouterLink :to="{ name: 'Index' }" :replace="true">
<a-button type="primary"> 返回首页 </a-button> <a-button type="primary">
{{ t('views.error.err403.backHome') }}
</a-button>
</RouterLink> </RouterLink>
<a-button type="default" @click="() => router.back()"> 返回 </a-button> <a-button type="default" @click="() => router.back()">
{{ t('views.error.err403.back') }}
</a-button>
</template> </template>
</a-result> </a-result>
</template> </template>

View File

@@ -1,23 +1,30 @@
<script setup lang="ts"></script> <script setup lang="ts">
import useI18n from '@/hooks/useI18n';
const { t } = useI18n();
</script>
<template> <template>
<a-result <a-result
status="404" status="404"
title="找不到匹配页面" :title="t('views.error.err404.ttile')"
sub-title="对不起您正在寻找的页面不存在" :sub-title="t('views.error.err404.subTitle')"
> >
<template #extra> <template #extra>
<RouterLink :to="{ name: 'Index' }" :replace="true"> <RouterLink :to="{ name: 'Index' }" :replace="true">
<a-button type="primary"> 返回首页 </a-button> <a-button type="primary">
{{ t('views.error.err404.backHome') }}
</a-button>
</RouterLink> </RouterLink>
</template> </template>
<a-typography> <a-typography>
<a-typography-title> 找不到网页 </a-typography-title> <a-typography-title>
{{ t('views.error.err404.tipTitle') }}
</a-typography-title>
<a-typography-paragraph> <a-typography-paragraph>
1. 尝试检查URL的错误然后按浏览器上的刷新按钮 1. {{ t('views.error.err404.paragraph') }}
</a-typography-paragraph> </a-typography-paragraph>
<a-typography-paragraph> <a-typography-paragraph>
2. 尝试在我们的应用程序中找到其他内容 2. {{ t('views.error.err404.paragraph1') }}
</a-typography-paragraph> </a-typography-paragraph>
</a-typography> </a-typography>
</a-result> </a-result>