!51 增加功能:webapi 路由不使用 /api 开头时抛错 403

Merge pull request !51 from Argo/dev
This commit is contained in:
Argo 2019-12-08 11:41:30 +08:00 committed by Gitee
commit c9c591a582
4 changed files with 14 additions and 6 deletions

View File

@ -93,6 +93,8 @@ namespace Bootstrap.Admin.Controllers
[HttpPost()]
public async Task<IActionResult> Mobile([FromServices]ISMSProvider provider, string phone, string code)
{
if (string.IsNullOrEmpty(phone) || string.IsNullOrEmpty(code)) return RedirectLogin();
var auth = provider.Validate(phone, code);
HttpContext.Log(phone, auth);
if (auth)
@ -144,6 +146,8 @@ namespace Bootstrap.Admin.Controllers
[HttpPost]
public async Task<IActionResult> Login(string userName, string password, string remember)
{
if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(password)) return RedirectLogin();
var auth = UserHelper.Authenticate(userName, password);
HttpContext.Log(userName, auth);
return auth ? await SignInAsync(userName, remember == "true") : View("Login", new LoginModel() { AuthFailed = true });

View File

@ -157,7 +157,7 @@ $(function () {
});
// 菜单弹窗过滤条件
$('.modal-footer > .flex-fill.d-none').addClass('d-sm-block')
$('.modal-footer > .flex-fill.d-none').addClass('d-sm-block');
$('.custom-radio').on('click', ':radio', function (e) {
var filter = $(this).val();
if (filter === 'all') {
@ -173,12 +173,16 @@ $(function () {
}
});
// 用户列表过滤
var $userFilter = $('#useFilter').on('input', 'input', function (e) {
var userFilterFunc = function (e) {
var userName = $(this).val();
$userFilter.next().find('.checkbox-label').each(function (index, element) {
if ($(element).text().toLocaleLowerCase().indexOf(userName.toLocaleLowerCase()) === -1) $(element).parents(".form-group").hide();
else $(element).parents(".form-group").show();
});
});
};
// 用户列表过滤
var $userFilter = $('#useFilter')
.on('input', 'input', userFilterFunc)
.on('click', 'button', function (e) { $(this).parent().prev().trigger('input'); });
});

View File

@ -6,7 +6,7 @@
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="3.0.1" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="3.0.2" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="3.0.3" />
<PackageReference Include="Longbow" Version="3.0.1" />
<PackageReference Include="Longbow.Cache" Version="3.0.3" />
<PackageReference Include="Longbow.Data" Version="3.0.1" />

View File

@ -6,7 +6,7 @@
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="3.0.1" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="3.0.2" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="3.0.3" />
<PackageReference Include="Longbow" Version="3.0.1" />
<PackageReference Include="Longbow.Cache" Version="3.0.3" />
<PackageReference Include="Longbow.Data" Version="3.0.1" />