The open source simple and complete warehouse management system is derived from our many years of experience in implementing erp projects. We stripped the original commercial system wms function and opened it up for free, hoping to help the majority of small and medium-sized enterprises. At present, the system supports cross-platform。
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using ModernWMS.Core.JWT;
using ModernWMS.Core.Utility;
using System.Linq;
namespace ModernWMS.Core.Controller
{
/// <summary>
/// base controller
/// </summary>
//[Authorize]
[Produces("application/json")]
public class BaseController : ControllerBase
{
/// <summary>
/// current user
/// </summary>
public CurrentUser CurrentUser
{
get
{
if (User != null && User.Claims.ToList().Count > 0)
{
var Claim = User.Claims.First(claim => claim.Type == ClaimValueTypes.Json);
return Claim == null ? new CurrentUser() : JsonHelper.DeserializeObject<CurrentUser>(Claim.Value);
}
else
{
return new CurrentUser();
}
}
}
public BaseController()
{
}
}
}