修改了编辑框1114

This commit is contained in:
2025-08-13 17:11:53 +08:00
parent 6449dd9d19
commit 220781f044
+16 -4
View File
@@ -46,6 +46,18 @@
// 获取用户store实例
const userStore = useUserStore()
// 根据环境动态设置UEditor路径
const isProduction = computed(() => {
return apiBase.includes('dev-casedata.igandan.com') || apiBase.includes('casedata.igandan.com')
})
const ueditorBasePath = computed(() => {
if (isProduction.value) {
return '/admin/web/UEditorPlus/'
}
return '/UEditorPlus/'
})
const props = defineProps({
// 内容
modelValue: {
@@ -86,8 +98,8 @@
const editorConfig = reactive({
// 基础路径配置 - 必须正确设置,避免路径拼接问题
UEDITOR_HOME_URL: '/UEditorPlus/',
UEDITOR_CORS_URL: '/UEditorPlus/',
UEDITOR_HOME_URL: ueditorBasePath.value,
UEDITOR_CORS_URL: ueditorBasePath.value,
// 不从服务器加载配置,使用本地配置
loadConfigFromServer: false,
@@ -387,8 +399,8 @@
// 组件挂载后的处理
onMounted(() => {
// 在UEditor加载前设置全局配置,避免路径问题
window.UEDITOR_HOME_URL = '/UEditorPlus/';
window.UEDITOR_CORS_URL = '/UEditorPlus/';
window.UEDITOR_HOME_URL = ueditorBasePath.value;
window.UEDITOR_CORS_URL = ueditorBasePath.value;
// 设置UEditor的全局上传成功回调
window.UEDITOR_CONFIG = window.UEDITOR_CONFIG || {};