UEditor学习

拉取远程图片上传oss

serverUrl: "/upload",//服务器主要地址,默认为URL + "php/controller.php"
catcherActionName:'catcher',//服务器上传的action,用于区分不同的上传标识
catcherFieldName:'file',//服务器上传的name
catcherUrlPrefix:"",//前缀

在controller.php中设置不同的action和返回,在Uploader.class.php文件中用拉取远程图片方法为saveRemote();

上传目录
上传目录注释掉,上传到OSS,其中$img为文件内容,返回url

$bucket = $img;
$ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
$ossClient->putObject($bucket, $object, $filePath);

成功后返回网址和成功标识

$this->stateInfo = $this->stateMap[0];
$this->fullName = $url;

layui和工具栏浮动冲突,修改了滑动事件,来进行浮动

//编辑器距离顶部高度
    let top_container = $('.detail').offset().top;
    //头部高度
    let header_height = $('.layui-header').height();
    $('.layui-body').scroll(function() {
        let scroll_H = $('.layui-body').scrollTop();  //滚动高度

        if (scroll_H > (top_container - header_height)) {
            $('#edui1_toolbarbox').css({'z-index': 20000001,'position' : 'fixed', 'top' : '60px', 'height' : '103px', 'width' : '698px'})
        } else {
            $('#edui1_toolbarbox').attr('style', '');
        }
    });
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值