feat(readme.md): 增加Gitee Releases版本信息
This commit is contained in:
parent
3939447d89
commit
9585c8fe28
|
@ -29,5 +29,19 @@ namespace Bootstrap.Admin.Controllers.Api
|
|||
var result = regex.Select((m, i) => $"{labels[i]} {m.Groups[1].Value}");
|
||||
return new JsonResult(new { schemaVersion = 1, label = string.Join(" ", result), message = "sweet world", color = "orange" });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="httpClientFactory"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ActionResult> Releases([FromServices]IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
var client = httpClientFactory.CreateClient();
|
||||
var content = await client.GetStringAsync("https://gitee.com/LongbowEnterprise/BootstrapAdmin/releases");
|
||||
var regex = Regex.Match(content, "<a href=\"/LongbowEnterprise/BootstrapAdmin/releases/([^\\s]+)\" target=\"_blank\">", RegexOptions.IgnoreCase);
|
||||
var result = regex.Groups[1].Value;
|
||||
return new JsonResult(new { schemaVersion = 1, label = result, message = "sweet world", color = "orange" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bootstrap.Admin.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[AllowAnonymous]
|
||||
public class ToolsController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IActionResult Index()
|
||||
{
|
||||
var returnUrl = Request.Query[CookieAuthenticationDefaults.ReturnUrlParameter].ToString();
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
# BootstrapAdmin
|
||||
|
||||
## Version & Licenses
|
||||
[![Build status](https://img.shields.io/github/tag-date/ArgoZhang/BootstrapAdmin.svg?logo=visual-studio-code&logoColor=red&label=build)](https://github.com/ArgoZhang/BootstrapAdmin/releases)
|
||||
[![Release Tag](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=red&label=release&url=https%3A%2F%2Fba.sdgxgz.com%2FBA%2Fapi%2FGitee%2FReleases)](http://ba.sdgxgz.com/BA/Tools/Index?ReturnUrl=https%3A%2F%2Fgitee.com%2FLongbowEnterprise%2FBootstrapAdmin%2Freleases)
|
||||
[![Gitee license](https://img.shields.io/github/license/argozhang/bootstrapadmin.svg?logo=git&logoColor=red)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/blob/master/LICENSE)
|
||||
|
||||
## Gitee
|
||||
|
|
Loading…
Reference in New Issue