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