90 lines
2.7 KiB
C#
90 lines
2.7 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
namespace qbridge.Controllers
|
|
{
|
|
[Route("[controller]")]
|
|
[ApiController]
|
|
[Produces("application/json")]
|
|
public class QBridgeController : ControllerBase
|
|
{
|
|
|
|
public QBridgeController()
|
|
{
|
|
|
|
}
|
|
|
|
// [HttpGet]
|
|
// public ContentResult Index()
|
|
// {
|
|
// var errorBlock = string.Empty;
|
|
|
|
// var resp = $@"<html lang=""en"">
|
|
// <head>
|
|
// <meta charset=""utf-8"">
|
|
// <meta name=""viewport"" content=""width=device-width, initial-scale=1, shrink-to-fit=no"">
|
|
// <title>AyaNova QBOI bridge authorization server</title>
|
|
// <script src=/jquery-1.9.1.js></script>
|
|
|
|
// </head>
|
|
// <body >
|
|
|
|
// <div style=""text-align: center;"">
|
|
// {errorBlock}
|
|
// <div style=""display: inline-block;text-align:left;"">
|
|
// <h1>QBOI Bridge</h1>
|
|
|
|
// <form action=""/QBridge"" method=""post"">
|
|
// <div class=""container"">
|
|
// <div>
|
|
// <label for=""uname""><b>User name</b></label>
|
|
// <input type=""text"" placeholder=""Enter Username"" id=""uname"" name=""uname"" required>
|
|
// </div>
|
|
// <br/>
|
|
// <div>
|
|
// <label for=""pwd""><b>Password</b></label>
|
|
// <input type=""password"" placeholder=""Enter Password"" id=""pwd"" name=""pwd"" required>
|
|
// </div>
|
|
// <br/>
|
|
// <div>
|
|
// <button type=""submit"">Login</button>
|
|
// </div>
|
|
// </div>
|
|
// </form>
|
|
|
|
// </div>
|
|
// </div>
|
|
// </body>
|
|
// </html>";
|
|
|
|
|
|
// return new ContentResult
|
|
// {
|
|
// ContentType = "text/html",
|
|
// StatusCode = 200,
|
|
// Content = resp
|
|
// };
|
|
|
|
// }
|
|
|
|
// [HttpPost]
|
|
// public IActionResult Index([FromForm]string uname,[FromForm]string pwd)
|
|
// {
|
|
// return Content($"Uname: {uname}, Password: {pwd}");
|
|
// }
|
|
|
|
|
|
// public class CBUserModel
|
|
// {
|
|
// [Required(ErrorMessage = "UserName is required")]
|
|
// public string UserName { get; set; }
|
|
// [Required(ErrorMessage = "Password is required")]
|
|
// [DataType(DataType.Password)]
|
|
// public string Password { get; set; }
|
|
// }
|
|
// *************************************************************************************************************
|
|
|
|
|
|
|
|
}
|
|
} |