mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-03-31 05:33:24 +08:00
转移.net core 3.1,为.NET 5做准备
This commit is contained in:
37
OpenAuth.WebApi/Controllers/SysConfController.cs
Normal file
37
OpenAuth.WebApi/Controllers/SysConfController.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Infrastructure;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using OpenAuth.App;
|
||||
|
||||
namespace OpenAuth.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统配置信息
|
||||
/// </summary>
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
public class SysConfController :ControllerBase
|
||||
{
|
||||
private IOptions<AppSetting> _appConfiguration;
|
||||
|
||||
public SysConfController(IOptions<AppSetting> appConfiguration)
|
||||
{
|
||||
_appConfiguration = appConfiguration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否Identity认证
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpGet]
|
||||
public Response<bool> IsIdentityAuth()
|
||||
{
|
||||
return new Response<bool>
|
||||
{
|
||||
Result = _appConfiguration.Value.IsIdentityAuth
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user