ThinkPHP5使用富文本UEditor,将富文本编辑框内上传在本地的图片,修改到阿里云对象存储OSS
ThinkPHP5加载UEditor ···· 略
UEditor下载:https://ueditor.baidu.com/website/download.html#ueditor
阿里云对象存储SDK下载:https://github.com/aliyun/aliyun-oss-php-sdk
一、配置项
ueditor目录:\public\static\admin\lib\ueditor\1.4.3
OSS配置文件目录:\application\config\oos.php
OSS SDK目录:\extend\oos
二、代码
1、OSS配置文件
<?php
return [
'endpoint' => 'xxxx',
'accessKeyId' => 'xxxxxxxxxxx',
'accessKeySecret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
'bucket' => 'xxxxx',
'uploadurl' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', //个人配置用,上传图片访问头部完整链接
];
2、在UEditor下写入