From 86e9effb18674d8ab1d857027c79db33b028a08c Mon Sep 17 00:00:00 2001 From: yanglbme Date: Tue, 13 Oct 2020 10:22:23 +0800 Subject: [PATCH] feat: update `uploadImgDialog` component --- src/components/CodemirrorEditor/uploadImgDialog.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/CodemirrorEditor/uploadImgDialog.vue b/src/components/CodemirrorEditor/uploadImgDialog.vue index 6559e1a..2c598cf 100644 --- a/src/components/CodemirrorEditor/uploadImgDialog.vue +++ b/src/components/CodemirrorEditor/uploadImgDialog.vue @@ -249,19 +249,18 @@ export default { let checkRes = true, errMessage = ''; switch (localStorage.getItem('imgHost')) { - case "github": + case 'github': checkRes = this.formGitHub.repo && this.formGitHub.accessToken; - errMessage = !checkRes ? '请先配置 GitHub 图床参数' : ''; + errMessage = checkRes ? '' : '请先配置 GitHub 图床参数'; break; case 'aliOSS': checkRes = this.formAliOSS.accessKeyId && this.formAliOSS.accessKeySecret && this.formAliOSS.bucket && this.formAliOSS.region; - errMessage = !checkRes ? '请先配置阿里云 OSS 参数' : ''; + errMessage = checkRes ? '' : '请先配置阿里云 OSS 参数'; break; case 'txCOS': checkRes = this.formTxCOS.secretId && this.formTxCOS.secretKey && this.formTxCOS.bucket && this.formTxCOS.region; - errMessage = !checkRes ? '请先配置腾讯云 COS 参数' : ''; + errMessage = checkRes ? '' : '请先配置腾讯云 COS 参数'; break; - default: } errMessage && this.$message.error(errMessage); return checkRes;