Baidu editor UEditor service interface

Baidu UEditor (pictures, files, etc.) uploading back-end services, supporting .Net Core 2.0+, easy to use,

#Support front and back end separation

Use tutorial

When the current background service interface address is http: // localhost: 58898

1. It is recommended to install with NuGet: Install-Package UEditor.Server.Core -Version 1.0.1

Source code: https://github.com/mfkuyg61/UEditor.Server.Core

2. Add in ConfigureServices

services.AddUEditor (a => 
{ 
  a.WebRootPath = _hostingEnvironment.WebRootPath; // is _hostingEnvironment is IHostingEnvironment 
  a.ConfigFile = " ueditor \ ueditor.json " ; // relative path of configuration file 
  a.IsCache = false ; // no Use cache 
  a.ControllerName = " / controller " ; // Backend interface 
  a.WithOrigins = new  string [] { " http: // localhost: 58898 " }; // Access whitelist 
});

 

3. Add in Configure

app.UseUEditor (); // Baidu editor, please put in front of app.UseCors ()

 

4.UEditor configuration, take UEditor.Server.Core.Demo as an example

Configuration in ueditor.config.js

window.UEDITOR_HOME_URL = '/ueditor/'
window.UEDITOR_CONFIG={
    serverUrl:'http://localhost:58898/controller'
}

 

Guess you like

Origin www.cnblogs.com/zhouliuyi/p/12735148.html