修复前端数据库报错

This commit is contained in:
2025-05-19 16:04:45 +08:00
parent 41a2d69f22
commit 1587524031
11 changed files with 47 additions and 55 deletions
@@ -1,4 +1,4 @@
<?php /*a:2:{s:60:"E:\Demos\DemoOwns\PHP\yunzer\app\admin\view\articles\add.php";i:1747626013;s:61:"E:\Demos\DemoOwns\PHP\yunzer\app\admin\view\public\header.php";i:1746849526;}*/ ?>
<?php /*a:2:{s:60:"E:\Demos\DemoOwns\PHP\yunzer\app\admin\view\articles\add.php";i:1747641342;s:61:"E:\Demos\DemoOwns\PHP\yunzer\app\admin\view\public\header.php";i:1746849526;}*/ ?>
<!DOCTYPE html>
<html>
<head>
@@ -295,7 +295,7 @@
// 配置图片上传
editorConfig.MENU_CONF['uploadImage'] = {
server: '<?php echo url("index/upload_imgs"); ?>',
server: '<?php echo url("index/upload_img"); ?>',
fieldName: 'file',
maxFileSize: 10 * 1024 * 1024, // 10M
maxNumberOfFiles: 10,
@@ -330,13 +330,8 @@
customInsert(res, insertFn) {
// res 即服务端的返回结果
if (res.code === 0 && res.data) {
// res.data中获取src字段
const url = String(res.data.src || '');
if (url) {
insertFn(url);
} else {
layer.msg('图片地址无效', { icon: 2 });
}
// 直接使用res.data作为图片地址
insertFn(res.data);
} else {
layer.msg('图片上传失败', { icon: 2 });
}