Skip to content

Commit 46c2812

Browse files
committed
验证输入内容
1 parent fecbcf2 commit 46c2812

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

heroku/web/index.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,22 @@ class="mdui-img-fluid"
158158
</div>
159159
</div>
160160
<script>
161-
document.getElementById('submit-btn').onclick = function () {
161+
let submitBtn = document.getElementById('submit-btn');
162+
163+
submitBtn.onclick = function () {
162164
let ffToken = document.getElementById('pwd').value;
163165

166+
ffToken = ffToken.replace(/\s/g, '');
167+
168+
if (ffToken.length < 1) {
169+
mdui.snackbar({message: '请输入令牌'});
170+
171+
return;
172+
}
173+
174+
submitBtn.disabled = true;
175+
submitBtn.innerText = '送信中...';
176+
164177
window.location.href = '?ff-token=' + ffToken;
165178
}
166179
</script>

0 commit comments

Comments
 (0)