fix: 演示系统下不需要输入用户名与口令跳转到 Gitee 认证

This commit is contained in:
Argo Zhang 2019-09-19 19:14:40 +08:00
parent 7b2b9bfb08
commit 6fbecff864
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@
}
<div class="container">
<input id="imgUrl" type="hidden" value="@Model.ImageLibUrl" />
<form id="login" method="post" class="form-signin" data-demo="True">
<form id="login" method="post" class="form-signin" data-demo="@Model.IsDemo">
<h2 class="form-signin-heading">@Model.Title</h2>
<div class="login-wrap" data-auth="@Model.AuthFailed" data-toggle="LgbValidate" data-valid-button="button[type='submit']">
<div class="alert alert-danger d-none" asp-condition="@Model.AuthFailed">用户名或密码错误!</div>

View File

@ -126,10 +126,10 @@
var $loginPwd = $('#loginPwd');
var $loginSMS = $('#loginSMS');
if ($login.attr('data-demo') === 'True') {
$login.find('[data-valid="true"]').attr('data-valid', 'false');
$login.on('submit', function (e) {
var model = $loginType.attr('data-value');
if (model === 'username') {
$login.find('[data-valid="true"]').attr('data-valid', 'false');
if ($username.val() === '' && $password.val() === '') {
e.preventDefault();
location.href = "Gitee";