修改了编辑框1114444133444
This commit is contained in:
parent
5005bf94c3
commit
bfb48727e7
@ -101,11 +101,11 @@
|
|||||||
// UEditor依赖文件配置
|
// UEditor依赖文件配置
|
||||||
const editorDependencies = computed(() => {
|
const editorDependencies = computed(() => {
|
||||||
if (isProduction.value) {
|
if (isProduction.value) {
|
||||||
// 线上环境:使用完整路径
|
// 线上环境:使用相对路径,让UEDITOR_HOME_URL处理基础路径
|
||||||
return [
|
return [
|
||||||
'/admin/web/UEditorPlus/ueditor.config.js',
|
'ueditor.config.js',
|
||||||
'/admin/web/UEditorPlus/ueditor.all.js',
|
'ueditor.all.js',
|
||||||
'/admin/web/UEditorPlus/lang/zh-cn/zh-cn.js'
|
'lang/zh-cn/zh-cn.js'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
// 本地环境:使用相对路径
|
// 本地环境:使用相对路径
|
||||||
@ -118,8 +118,12 @@
|
|||||||
|
|
||||||
const editorConfig = reactive({
|
const editorConfig = reactive({
|
||||||
// 基础路径配置 - 必须正确设置,避免路径拼接问题
|
// 基础路径配置 - 必须正确设置,避免路径拼接问题
|
||||||
UEDITOR_HOME_URL: ueditorBasePath.value,
|
get UEDITOR_HOME_URL() {
|
||||||
UEDITOR_CORS_URL: ueditorBasePath.value,
|
return ueditorBasePath.value
|
||||||
|
},
|
||||||
|
get UEDITOR_CORS_URL() {
|
||||||
|
return ueditorBasePath.value
|
||||||
|
},
|
||||||
|
|
||||||
// 不从服务器加载配置,使用本地配置
|
// 不从服务器加载配置,使用本地配置
|
||||||
loadConfigFromServer: false,
|
loadConfigFromServer: false,
|
||||||
@ -418,13 +422,21 @@
|
|||||||
|
|
||||||
// 组件挂载后的处理
|
// 组件挂载后的处理
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 强制设置UEditor的全局路径配置
|
||||||
|
const currentUeditorBasePath = ueditorBasePath.value
|
||||||
|
console.log('设置UEditor全局路径:', currentUeditorBasePath)
|
||||||
|
|
||||||
// 在UEditor加载前设置全局配置,避免路径问题
|
// 在UEditor加载前设置全局配置,避免路径问题
|
||||||
window.UEDITOR_HOME_URL = ueditorBasePath.value;
|
window.UEDITOR_HOME_URL = currentUeditorBasePath;
|
||||||
window.UEDITOR_CORS_URL = ueditorBasePath.value;
|
window.UEDITOR_CORS_URL = currentUeditorBasePath;
|
||||||
|
|
||||||
// 设置UEditor的全局上传成功回调
|
// 设置UEditor的全局上传成功回调
|
||||||
window.UEDITOR_CONFIG = window.UEDITOR_CONFIG || {};
|
window.UEDITOR_CONFIG = window.UEDITOR_CONFIG || {};
|
||||||
|
|
||||||
|
// 强制覆盖全局配置中的路径
|
||||||
|
window.UEDITOR_CONFIG.UEDITOR_HOME_URL = currentUeditorBasePath;
|
||||||
|
window.UEDITOR_CONFIG.UEDITOR_CORS_URL = currentUeditorBasePath;
|
||||||
|
|
||||||
// 图片上传成功后的处理 - 关键配置
|
// 图片上传成功后的处理 - 关键配置
|
||||||
window.UEDITOR_CONFIG.onImageUploadSuccess = function(result) {
|
window.UEDITOR_CONFIG.onImageUploadSuccess = function(result) {
|
||||||
console.log('=== 图片上传成功回调开始 ===');
|
console.log('=== 图片上传成功回调开始 ===');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user