<textarea
id="edit"
name="article_content"
style="display: none;"
>{$row[article_content]}</textarea>
layui.use(['layedit'], function () {
var 'form', 'jquery', 'laydate', 'upload',layedit = layui.layedit
layedit.set({
uploadImage: {
url: '__CONTROLLER__/upload2?path=article'
}
})
layedit.build('edit')
})
function upload2($path=''){
$upload=new \Think\Upload();
$upload->maxSize=99999999;
$upload->exts=['jpg','jpeg','png','gif'];
$savePath=$path?'./upload/'.$path.'/':'./upload/';
$upload->rootPath=$savePath;
$upload->autoSub=false;
$info=$upload->upload();
$this->ajaxReturn([
'code'=>0,
'msg'=>'',
'data'=>[
'src'=>'https://'.$_SERVER['HTTP_HOST'].\str_replace('./','/',$savePath).$info[file][savename],
],
]);
}