修复编辑器图片地址
This commit is contained in:
parent
e89e0fa83d
commit
56497898ff
@ -426,8 +426,15 @@
|
|||||||
customInsert(res, insertFn) {
|
customInsert(res, insertFn) {
|
||||||
// res 即服务端的返回结果
|
// res 即服务端的返回结果
|
||||||
if (res.code === 0 && res.data) {
|
if (res.code === 0 && res.data) {
|
||||||
// 使用完整的URL
|
// 处理URL格式
|
||||||
const imageUrl = res.url || res.data;
|
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) {
|
if (imageUrl) {
|
||||||
insertFn(imageUrl);
|
insertFn(imageUrl);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -444,8 +444,15 @@
|
|||||||
customInsert(res, insertFn) {
|
customInsert(res, insertFn) {
|
||||||
// res 即服务端的返回结果
|
// res 即服务端的返回结果
|
||||||
if (res.code === 0 && res.data) {
|
if (res.code === 0 && res.data) {
|
||||||
// 使用完整的URL
|
// 处理URL格式
|
||||||
const imageUrl = res.url || res.data;
|
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) {
|
if (imageUrl) {
|
||||||
insertFn(imageUrl);
|
insertFn(imageUrl);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user