This commit is contained in:
vipg
2025-11-12 17:24:55 +08:00
parent 8159f03e8c
commit 6dd4a9a41a
16 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,117 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>资产管理系统 - 登录</title>
<!-- 引入外部依赖 -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<!-- 引入自定义配置和组件 -->
<script src="../assets/js/config/system.js"></script>
<script src="../assets/js/core/auth.js"></script>
<script src="../assets/js/core/message.js"></script>
<script src="../assets/js/core/loading.js"></script>
<!-- 新增引入Loading组件 -->
<script src="../assets/js/components/loading.js"></script>
<!-- 引入样式 -->
<link rel="stylesheet" href="../assets/css/dark-theme.css">
<link rel="stylesheet" href="../assets/css/common.css">
<style>
.login-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
padding: 20px;
}
.login-card {
width: 100%;
max-width: 400px;
background-color: var(--bg-light-color);
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
padding: 30px;
}
.login-header {
text-align: center;
margin-bottom: 30px;
}
.login-title {
font-size: 24px;
color: var(--primary-color);
margin-bottom: 8px;
}
.login-desc {
color: var(--text-secondary);
font-size: 14px;
}
.form-group {
margin-bottom: 20px;
}
.form-label {
display: block;
margin-bottom: 8px;
color: var(--text-primary);
font-weight: 500;
}
.login-btn {
width: 100%;
padding: 12px;
font-size: 16px;
margin-top: 10px;
}
</style>
</head>
<body class="dark-theme">
<div class="login-container">
<div class="login-card">
<div class="login-header">
<h2 class="login-title">资产管理系统</h2>
<p class="login-desc">金融资产一站式管理平台</p>
</div>
<form id="login-form">
<div class="form-group">
<label class="form-label" for="username">用户名</label>
<input type="text" id="username" class="input" placeholder="请输入用户名" required>
</div>
<div class="form-group">
<label class="form-label" for="password">密码</label>
<input type="password" id="password" class="input" placeholder="请输入密码" required>
</div>
<button type="submit" class="btn login-btn">登录</button>
</form>
</div>
</div>
<script>
// 等待DOM完全加载后再执行
$(document).ready(() => {
// 登录表单提交事件
$('#login-form').on('submit', async (e) => {
e.preventDefault();
const username = $('#username').val().trim();
const password = $('#password').val().trim();
if (!username || !password) {
Message.error('账号和密码不能为空');
return;
}
try {
Loading.show('正在登录...');
const result = await Auth.login(username, password);
Message.success(result.message);
setTimeout(() => {
window.location.href = 'index.html';
}, 1000);
} catch (error) {
Message.error(error.message || '登录失败,请重试');
} finally {
Loading.hide();
}
});
});
</script>
</body>
</html>