1、富文本编辑器介绍
KindEditor是一套开源的HTML可视化编辑器,主要用于让用户在网站上获得所见即所得编辑效果,兼容IE、Firefox、Chrome、Safari、Opera等主流浏览器。
2、入门案例
<script type="text/javascript">
$(function(){
KindEditor.ready(function(){
//在指定的位置创建富文本.
KindEditor.create("#editor")
})
})
</script>
</head>
<body>
<h1>富文本编辑器</h1>
<textarea style="width:700px;height:350px" id="editor"></textarea>
</body>
3、文件上传
文件上传的具体步骤:
* 1.准备文件目录
* 2.准备文件的全名 xxxx.jpg
* 3.准备文件上传的路径 D:/JT-SOFT/images/xxxx.jpg
* 4.将字节信息输出即可.
* 大小不要超过1M
4、文件上传优化
4.1、url优化
说明: 如果需要通过网络虚拟路径访问服务器.则应该按照如下的配置实现.
1、本地磁盘路径: D:\JT-SOFT\images\2020\09\30\a.jpg
2、网络虚拟路径: http://image.jt.com\2020\09\30\a.jpg
4.2、编辑pro配置文件
4.3、完成属性的动态赋值
package com.jt.service;
import com.jt.vo.ImageVO;
import org.springframework.beans.factory.annotation.Value;
import org