初始提交
This commit is contained in:
25
Services/Hncore.Pass.OSS/Controllers/UEditorController.cs
Normal file
25
Services/Hncore.Pass.OSS/Controllers/UEditorController.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using UEditor.Core;
|
||||
|
||||
namespace Hncore.Pass.OSS.Controllers
|
||||
{
|
||||
[Route("api/ueditor")]
|
||||
[AllowAnonymous]
|
||||
public class UEditorController : Controller
|
||||
{
|
||||
private readonly UEditorService _ueditorService;
|
||||
public UEditorController(UEditorService ueditorService)
|
||||
{
|
||||
this._ueditorService = ueditorService;
|
||||
}
|
||||
|
||||
[HttpGet, HttpPost]
|
||||
public ContentResult Upload()
|
||||
{
|
||||
var response = _ueditorService.UploadAndGetResponse(this.Request.HttpContext);
|
||||
return Content(response.Result, response.ContentType);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user