This commit is contained in:
wucongxing8150 2025-08-13 17:34:55 +08:00
parent bfb48727e7
commit c11a5bdbc5

View File

@ -424,6 +424,8 @@
onMounted(() => {
// UEditor
const currentUeditorBasePath = ueditorBasePath.value
console.log('=== UEditor路径配置开始 ===')
console.log('当前环境:', isProduction.value ? '线上' : '本地')
console.log('设置UEditor全局路径:', currentUeditorBasePath)
// UEditor
@ -437,6 +439,25 @@
window.UEDITOR_CONFIG.UEDITOR_HOME_URL = currentUeditorBasePath;
window.UEDITOR_CONFIG.UEDITOR_CORS_URL = currentUeditorBasePath;
//
Object.defineProperty(window, 'UEDITOR_HOME_URL', {
get: () => currentUeditorBasePath,
set: (value) => {
console.warn('尝试修改UEDITOR_HOME_URL:', value, ',强制保持为:', currentUeditorBasePath)
},
configurable: false
})
Object.defineProperty(window, 'UEDITOR_CORS_URL', {
get: () => currentUeditorBasePath,
set: (value) => {
console.warn('尝试修改UEDITOR_CORS_URL:', value, ',强制保持为:', currentUeditorBasePath)
},
configurable: false
})
console.log('=== UEditor路径配置完成 ===')
// -
window.UEDITOR_CONFIG.onImageUploadSuccess = function(result) {
console.log('=== 图片上传成功回调开始 ===');
@ -528,10 +549,29 @@
//
setTimeout(() => {
console.log('=== 延迟刷新UEditor配置开始 ===')
//
if (window.UEDITOR_HOME_URL !== currentUeditorBasePath) {
console.warn('检测到UEDITOR_HOME_URL被修改:', window.UEDITOR_HOME_URL, ',强制恢复为:', currentUeditorBasePath)
window.UEDITOR_HOME_URL = currentUeditorBasePath
}
if (window.UEDITOR_CORS_URL !== currentUeditorBasePath) {
console.warn('检测到UEDITOR_CORS_URL被修改:', window.UEDITOR_CORS_URL, ',强制恢复为:', currentUeditorBasePath)
window.UEDITOR_CORS_URL = currentUeditorBasePath
}
if (window.UE && window.UEDITOR_CONFIG) {
//
Object.assign(window.UEDITOR_CONFIG, editorConfig);
//
window.UEDITOR_CONFIG.UEDITOR_HOME_URL = currentUeditorBasePath;
window.UEDITOR_CONFIG.UEDITOR_CORS_URL = currentUeditorBasePath;
console.log('=== 延迟刷新UEditor配置完成 ===')
//
if (window.UEDITOR_CONFIG.onImageUploadSuccess) {
console.log('UEditor图片上传成功回调已设置');