修复编辑器图片地址

This commit is contained in:
云泽网 2025-05-21 01:07:52 +08:00
parent e89e0fa83d
commit 56497898ff
2 changed files with 18 additions and 4 deletions

View File

@ -426,8 +426,15 @@
customInsert(res, insertFn) {
// res 即服务端的返回结果
if (res.code === 0 && res.data) {
// 使用完整的URL
const imageUrl = res.url || res.data;
// 处理URL格式
let imageUrl = res.url || res.data;
// 确保URL以http开头
if (!imageUrl.startsWith('http')) {
imageUrl = '{$config["admin_domain"]}' + imageUrl;
}
// 移除多余的域名部分
imageUrl = imageUrl.replace('{$config["admin_domain"]}/{$config["admin_domain"]}', '{$config["admin_domain"]}');
if (imageUrl) {
insertFn(imageUrl);
} else {

View File

@ -444,8 +444,15 @@
customInsert(res, insertFn) {
// res 即服务端的返回结果
if (res.code === 0 && res.data) {
// 使用完整的URL
const imageUrl = res.url || res.data;
// 处理URL格式
let imageUrl = res.url || res.data;
// 确保URL以http开头
if (!imageUrl.startsWith('http')) {
imageUrl = '{$config["admin_domain"]}' + imageUrl;
}
// 移除多余的域名部分
imageUrl = imageUrl.replace('{$config["admin_domain"]}/{$config["admin_domain"]}', '{$config["admin_domain"]}');
if (imageUrl) {
insertFn(imageUrl);
} else {