From 761b2fc7b2405b67f21107a07b8178414d9a6f6d Mon Sep 17 00:00:00 2001 From: yanglbme Date: Sun, 13 Sep 2020 21:36:51 +0800 Subject: [PATCH] fix: update uploadImgDialog component --- src/components/CodemirrorEditor/uploadImgDialog.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/CodemirrorEditor/uploadImgDialog.vue b/src/components/CodemirrorEditor/uploadImgDialog.vue index 63f7e8e..87c9c2c 100644 --- a/src/components/CodemirrorEditor/uploadImgDialog.vue +++ b/src/components/CodemirrorEditor/uploadImgDialog.vue @@ -2,7 +2,7 @@ - + @@ -120,8 +120,13 @@ export default { } }, methods: { - changeimgHost() { + changeImgHost() { localStorage.setItem("imgHost", this.imgHost); + this.$message({ + showClose: true, + message: '已成功切换图床', + type: "success", + }); }, saveGitHubConfiguration() { if (!(this.formGitHub.repo && this.formGitHub.accessToken)) { @@ -179,7 +184,7 @@ export default { return false; }, validateConfig() { - switch (this.imgHost) { + switch (localStorage.getItem('imgHost')) { case "github": const { repo, accessToken @@ -189,6 +194,7 @@ export default { this.$message.error("请先配置 GitHub 图床参数"); return false; } + break; case 'aliOSS': const { accessKeyId, accessKeySecret, bucket, region, path