You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace HttpClientStudy.WebApp.Controllers
|
|
|
|
|
{
|
|
|
|
|
[Route("api/[controller]/[action]")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
public class AccountController : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
public AccountController() { }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Ping 测试接口
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <example>
|
|
|
|
|
/// Ping
|
|
|
|
|
/// </example>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public IActionResult Ping()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return Ok("pong");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取Token
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public IActionResult GetToken()
|
|
|
|
|
{
|
|
|
|
|
return new JsonResult(new { Code = 1, Message = "", Token = "a.b.c" });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|