add
This commit is contained in:
22
frontend/asset-assistant-system/.gitignore
vendored
22
frontend/asset-assistant-system/.gitignore
vendored
@@ -1,22 +0,0 @@
|
||||
# 依赖
|
||||
node_modules/
|
||||
.pnp/
|
||||
.pnp.js
|
||||
|
||||
# 构建产物
|
||||
dist/
|
||||
|
||||
# 日志
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# 编辑器配置
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# 操作系统文件
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"name": "asset-assistant-system",
|
||||
"version": "1.0.0",
|
||||
"description": "资产辅助管理系统",
|
||||
"main": "index.html",
|
||||
"scripts": {
|
||||
"dev": "serve",
|
||||
"build": "echo '构建脚本待实现'",
|
||||
"test": "echo '测试脚本待实现'"
|
||||
},
|
||||
"keywords": ["asset", "management", "system"],
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"serve": "^14.2.3"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@@ -22,6 +23,7 @@
|
||||
height: 100vh;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.login-card {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
@@ -30,28 +32,34 @@
|
||||
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;
|
||||
@@ -60,6 +68,7 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="dark-theme">
|
||||
<div class="login-container">
|
||||
<div class="login-card">
|
||||
@@ -82,31 +91,35 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 登录表单提交事件
|
||||
$('#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();
|
||||
}
|
||||
// 等待DOM完全加载后再执行
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
// 登录表单提交事件
|
||||
$('#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>
|
||||
Reference in New Issue
Block a user