修复编辑器图片地址
This commit is contained in:
parent
e89e0fa83d
commit
56497898ff
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user