From 5005bf94c39c6c28362a04d2c1c63d0adfeda9d0 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Wed, 13 Aug 2025 17:24:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A1=861114444133?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/UEditorPlus/ueditor.config.simple.js | 2 +- src/components/business/ueditor.vue | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/public/UEditorPlus/ueditor.config.simple.js b/public/UEditorPlus/ueditor.config.simple.js index df52ba7..f15238a 100644 --- a/public/UEditorPlus/ueditor.config.simple.js +++ b/public/UEditorPlus/ueditor.config.simple.js @@ -1,5 +1,5 @@ (function () { - var URL = window.UEDITOR_HOME_URL || getUEBasePath(document.currentScript || document.scripts[document.scripts.length - 1])); + var URL = window.UEDITOR_HOME_URL || getUEBasePath(document.currentScript || document.scripts[document.scripts.length - 1]); window.UEDITOR_CONFIG = { UEDITOR_HOME_URL: URL, diff --git a/src/components/business/ueditor.vue b/src/components/business/ueditor.vue index 8879393..d1814e2 100644 --- a/src/components/business/ueditor.vue +++ b/src/components/business/ueditor.vue @@ -99,11 +99,22 @@ const editorReady = ref(false) // UEditor依赖文件配置 - const editorDependencies = [ + const editorDependencies = computed(() => { + if (isProduction.value) { + // 线上环境:使用完整路径 + return [ + '/admin/web/UEditorPlus/ueditor.config.js', + '/admin/web/UEditorPlus/ueditor.all.js', + '/admin/web/UEditorPlus/lang/zh-cn/zh-cn.js' + ] + } + // 本地环境:使用相对路径 + return [ 'ueditor.config.js', 'ueditor.all.js', 'lang/zh-cn/zh-cn.js' - ] + ] + }) const editorConfig = reactive({ // 基础路径配置 - 必须正确设置,避免路径拼接问题 @@ -489,7 +500,7 @@ }; // 检查依赖文件是否存在 - editorDependencies.forEach(dep => { + editorDependencies.value.forEach(dep => { fetch(dep) .then(response => { if (!response.ok) {