From 1adbc1f46932d4f9f1812d61f945532f4ad601a1 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Mon, 23 Nov 2020 15:41:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/en.ts | 2 ++ src/i18n/zh.ts | 2 ++ src/utils/common.ts | 9 ++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/i18n/en.ts b/src/i18n/en.ts index c207865..9d46070 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -312,6 +312,8 @@ export default { querentuichu: "You confirm to exit?", huobitishi: "Attention! You can only change the currency once!", zhuanmazhong: "Transcoding in", + leixingcuowu:"File type error", + zuida:"maximum", shichangtishi:"", renshutishi: '', tixianzhu: "", diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index 75ec07e..bfa6df7 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -312,6 +312,8 @@ export default { querentuichu: "您确认退出?", huobitishi: "请注意,货币一旦修改,不能变动。", zhuanmazhong: "转码中", + leixingcuowu:"文件类型错误", + zuida:"最大", shichangtishi:"", renshutishi: '', tixianzhu:"", diff --git a/src/utils/common.ts b/src/utils/common.ts index f54cf43..7eaffce 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -1,4 +1,6 @@ import { message } from 'ant-design-vue'; +import { geti18n } from './i18n'; +const lan = geti18n() /** * 图片转Base64 @@ -68,7 +70,7 @@ export function provenimg(file: any): boolean | void{ console.log(ntype) const size = 2 * 1024 * 1024; if(file.size > size){ - message.error("最大2MB") + message.error(lan.$t('zuida') + "2MB") return false; } let istype = false @@ -93,13 +95,13 @@ export function provenvideo(file: any, isvideo?: boolean): boolean{ if(isvideo){ const size = 500 * 1024 * 1024; if(file.size > size){ - message.error("最大500MB") + message.error(lan.$t('zuida') + "500MB") return false; } }else{ const size = 100 * 1024 * 1024; if(file.size > size){ - message.error("最大100MB") + message.error(lan.$t('zuida') + "100MB") return false; } } @@ -108,5 +110,6 @@ export function provenvideo(file: any, isvideo?: boolean): boolean{ return true; } } + message.error(lan.$t("leixingcuowu")) return false; } \ No newline at end of file