This commit is contained in:
parent
c5e02a5fec
commit
09bfe63b27
|
|
@ -150,6 +150,7 @@
|
|||
|
||||
<form id="login-form" method="post" action="/login">
|
||||
<input type="hidden" id="csrf-parameter" name="" value="" />
|
||||
<input type="hidden" id="client-id" name="client_id" value="" />
|
||||
|
||||
<div class="form-group">
|
||||
<label for="username">用户名</label>
|
||||
|
|
@ -180,11 +181,17 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
// 页面加载时检查错误参数
|
||||
// 页面加载时检查错误参数和client_id
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
// 检查是否有错误参数
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const error = urlParams.get('error');
|
||||
const clientId = urlParams.get('client_id');
|
||||
|
||||
// 设置client_id到隐藏字段
|
||||
if (clientId) {
|
||||
document.getElementById('client-id').value = clientId;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
const errorMessage = document.getElementById('error-message');
|
||||
|
|
@ -197,12 +204,21 @@
|
|||
document.getElementById('login-form').addEventListener('submit', function(e) {
|
||||
const username = document.getElementById('username').value.trim();
|
||||
const password = document.getElementById('password').value.trim();
|
||||
const tenantCode = document.getElementById('tenant-code').value.trim();
|
||||
const clientId = document.getElementById('client-id').value.trim();
|
||||
|
||||
if (!username || !password) {
|
||||
e.preventDefault();
|
||||
showError('请输入用户名和密码');
|
||||
return;
|
||||
}
|
||||
|
||||
// 打印调试信息
|
||||
console.log('提交登录信息:', {
|
||||
username: username,
|
||||
tenantCode: tenantCode,
|
||||
clientId: clientId
|
||||
});
|
||||
});
|
||||
|
||||
// 显示错误信息
|
||||
|
|
|
|||
Loading…
Reference in New Issue