From 6a081ee805ce158a92f3eca0ed3d80851fbfaf9e Mon Sep 17 00:00:00 2001 From: Chopper711 Date: Thu, 11 Jun 2026 16:02:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=20OSS=20CDN=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting-manage/setting/OSS_SETTING.vue | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/manager/src/views/sys/setting-manage/setting/OSS_SETTING.vue b/manager/src/views/sys/setting-manage/setting/OSS_SETTING.vue index ce00669b..98fdb80f 100644 --- a/manager/src/views/sys/setting-manage/setting/OSS_SETTING.vue +++ b/manager/src/views/sys/setting-manage/setting/OSS_SETTING.vue @@ -84,6 +84,17 @@ 文件访问路径,例如:/files 或完整域名 + + + + + + + + + 开启后接口输出图片资源时替换为该前缀,关闭时返回原始存储地址 + +
@@ -121,6 +132,8 @@ export default { tencentCOSEndPoint: "", localFilePath: "data/uploads", localFileUrlPrefix: "/files", + cdnEnabled: false, + cdnUrlPrefix: "", }, result:"" }; @@ -133,6 +146,10 @@ export default { // 保存 submit(name) { let that = this; + if (this.formValidate.cdnEnabled && !this.formValidate.cdnUrlPrefix) { + this.$Message.error("请填写CDN访问前缀"); + return; + } if (handleSubmit(that, name)) { this.setupSetting() } @@ -151,8 +168,11 @@ export default { init() { this.result = JSON.parse(this.res); - this.$set(this, "formValidate", {...this.result}); + this.$set(this, "formValidate", {...this.formValidate, ...this.result}); Object.keys(this.formValidate).forEach((item) => { + if (item === "cdnEnabled" || item === "cdnUrlPrefix") { + return; + } this.ruleValidate[item] = [ { required: true,