修改了编辑框1114
This commit is contained in:
parent
6449dd9d19
commit
220781f044
@ -46,6 +46,18 @@
|
|||||||
// 获取用户store实例
|
// 获取用户store实例
|
||||||
const userStore = useUserStore()
|
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({
|
const props = defineProps({
|
||||||
// 内容
|
// 内容
|
||||||
modelValue: {
|
modelValue: {
|
||||||
@ -86,8 +98,8 @@
|
|||||||
|
|
||||||
const editorConfig = reactive({
|
const editorConfig = reactive({
|
||||||
// 基础路径配置 - 必须正确设置,避免路径拼接问题
|
// 基础路径配置 - 必须正确设置,避免路径拼接问题
|
||||||
UEDITOR_HOME_URL: '/UEditorPlus/',
|
UEDITOR_HOME_URL: ueditorBasePath.value,
|
||||||
UEDITOR_CORS_URL: '/UEditorPlus/',
|
UEDITOR_CORS_URL: ueditorBasePath.value,
|
||||||
|
|
||||||
// 不从服务器加载配置,使用本地配置
|
// 不从服务器加载配置,使用本地配置
|
||||||
loadConfigFromServer: false,
|
loadConfigFromServer: false,
|
||||||
@ -387,8 +399,8 @@
|
|||||||
// 组件挂载后的处理
|
// 组件挂载后的处理
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 在UEditor加载前设置全局配置,避免路径问题
|
// 在UEditor加载前设置全局配置,避免路径问题
|
||||||
window.UEDITOR_HOME_URL = '/UEditorPlus/';
|
window.UEDITOR_HOME_URL = ueditorBasePath.value;
|
||||||
window.UEDITOR_CORS_URL = '/UEditorPlus/';
|
window.UEDITOR_CORS_URL = ueditorBasePath.value;
|
||||||
|
|
||||||
// 设置UEditor的全局上传成功回调
|
// 设置UEditor的全局上传成功回调
|
||||||
window.UEDITOR_CONFIG = window.UEDITOR_CONFIG || {};
|
window.UEDITOR_CONFIG = window.UEDITOR_CONFIG || {};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user