百度UEditor(图片、文件等)上传所依赖的后端服务,支持.Net Core 2.0+,简单易用,
#支持前后端分离
当前后台服务接口地址为http://localhost:58898时
源码:https://github.com/mfkuyg61/UEditor.Server.Core
services.AddUEditor(a => { a.WebRootPath = _hostingEnvironment.WebRootPath;//为_hostingEnvironment为IHostingEnvironment a.ConfigFile = "ueditor\ueditor.json";//配置文件相对路径 a.IsCache = false;//不使用缓存 a.ControllerName = "/controller";//后台接口 a.WithOrigins = new string[] { "http://localhost:58898" };//访问白名单 });
app.UseUEditor();//百度编辑器,请放在app.UseCors()前面
ueditor.config.js中配置
window.UEDITOR_HOME_URL = ‘/ueditor/‘ window.UEDITOR_CONFIG={ serverUrl:‘http://localhost:58898/controller‘ }
原文:https://www.cnblogs.com/zhouliuyi/p/12735148.html