312 lines
13 KiB
HTML
312 lines
13 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>登录 - A-BOT 管理后台</title>
|
|
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
|
|
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
|
|
<link rel="stylesheet" href="/static/css/element-ui/theme-chalk/index.min.css">
|
|
<script src="/static/js/chart.js"></script>
|
|
<script src="/static/js/vue.js"></script>
|
|
<script src="/static/js/element-ui/index.min.js"></script>
|
|
<script src="/static/js/axios.min.js"></script>
|
|
<style>
|
|
:root {
|
|
--bg: #eef3ef;
|
|
--bg-deep: #e4ebe6;
|
|
--text: #15211b;
|
|
--text-soft: #4f6258;
|
|
--border: rgba(101, 121, 113, 0.18);
|
|
--primary: #0f766e;
|
|
--primary-2: #0b5e57;
|
|
--danger: #ef4444;
|
|
--shadow: 0 24px 48px rgba(21, 33, 27, 0.10);
|
|
}
|
|
* { box-sizing: border-box; }
|
|
html, body { height: 100%; }
|
|
body {
|
|
margin: 0;
|
|
font-family: "Avenir Next", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
|
|
color: var(--text);
|
|
background:
|
|
radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 30%),
|
|
radial-gradient(circle at bottom right, rgba(234, 88, 12, 0.10), transparent 26%),
|
|
linear-gradient(165deg, var(--bg) 0%, var(--bg-deep) 100%);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
overflow: hidden;
|
|
}
|
|
.login-shell {
|
|
width: min(1120px, calc(100vw - 48px));
|
|
min-height: 680px;
|
|
display: grid;
|
|
grid-template-columns: 1.1fr 0.9fr;
|
|
border-radius: 32px;
|
|
overflow: hidden;
|
|
background: rgba(255,255,255,0.72);
|
|
border: 1px solid rgba(101,121,113,0.14);
|
|
backdrop-filter: blur(18px);
|
|
-webkit-backdrop-filter: blur(18px);
|
|
box-shadow: var(--shadow);
|
|
}
|
|
.login-showcase {
|
|
padding: 56px 52px;
|
|
background: linear-gradient(145deg, rgba(15,118,110,0.96), rgba(11,94,87,0.92));
|
|
color: #fff;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-between;
|
|
position: relative;
|
|
}
|
|
.login-showcase::after {
|
|
content: "";
|
|
position: absolute;
|
|
inset: 0;
|
|
background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 22%), radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08), transparent 24%);
|
|
pointer-events: none;
|
|
}
|
|
.showcase-top, .showcase-bottom { position: relative; z-index: 1; }
|
|
.brand {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
padding: 10px 14px;
|
|
border-radius: 999px;
|
|
background: rgba(255,255,255,0.12);
|
|
border: 1px solid rgba(255,255,255,0.12);
|
|
width: fit-content;
|
|
}
|
|
.brand-logo {
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 14px;
|
|
background: rgba(255,255,255,0.18);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.brand-logo img { width: 26px; height: 26px; }
|
|
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
|
|
.brand-copy strong { font-size: 15px; }
|
|
.brand-copy span { font-size: 12px; color: rgba(255,255,255,0.78); }
|
|
.hero-copy { margin-top: 36px; }
|
|
.hero-eyebrow {
|
|
font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,0.74); margin-bottom: 16px;
|
|
}
|
|
.hero-title {
|
|
font-size: 46px; line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 16px;
|
|
}
|
|
.hero-desc {
|
|
max-width: 460px; font-size: 16px; line-height: 1.75; color: rgba(255,255,255,0.86);
|
|
}
|
|
.showcase-metrics {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
gap: 14px;
|
|
}
|
|
.metric-item {
|
|
padding: 16px 18px;
|
|
border-radius: 20px;
|
|
background: rgba(255,255,255,0.12);
|
|
border: 1px solid rgba(255,255,255,0.12);
|
|
}
|
|
.metric-label { font-size: 12px; color: rgba(255,255,255,0.72); margin-bottom: 10px; }
|
|
.metric-value { font-size: 24px; font-weight: 700; color: #fff; }
|
|
.login-panel {
|
|
padding: 48px 42px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(247,251,248,0.96));
|
|
}
|
|
.login-card {
|
|
width: 100%;
|
|
max-width: 420px;
|
|
}
|
|
.panel-eyebrow {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 8px 12px;
|
|
border-radius: 999px;
|
|
background: rgba(15,118,110,0.08);
|
|
color: var(--primary);
|
|
font-size: 12px;
|
|
font-weight: 700;
|
|
letter-spacing: .08em;
|
|
text-transform: uppercase;
|
|
margin-bottom: 18px;
|
|
}
|
|
.panel-title { font-size: 30px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
|
|
.panel-desc { color: var(--text-soft); line-height: 1.7; font-size: 14px; margin-bottom: 24px; }
|
|
.login-form { width: 100%; }
|
|
.el-form-item { margin-bottom: 18px; }
|
|
.el-input__inner {
|
|
height: 48px;
|
|
border-radius: 14px;
|
|
border: 1px solid rgba(101,121,113,0.22);
|
|
background: rgba(247,251,248,0.94);
|
|
color: var(--text);
|
|
transition: all .18s ease;
|
|
}
|
|
.el-input__inner:focus {
|
|
border-color: rgba(15,118,110,0.42);
|
|
box-shadow: 0 0 0 4px rgba(15,118,110,0.10);
|
|
background: #fff;
|
|
}
|
|
.el-form-item__content { margin-left: 0 !important; }
|
|
.login-button {
|
|
width: 100%;
|
|
height: 48px;
|
|
border: none;
|
|
border-radius: 14px;
|
|
background: linear-gradient(135deg, var(--primary), var(--primary-2));
|
|
color: #fff;
|
|
font-weight: 700;
|
|
font-size: 15px;
|
|
box-shadow: 0 14px 28px rgba(15,118,110,0.20);
|
|
}
|
|
.login-button:hover, .login-button:focus {
|
|
opacity: .96;
|
|
transform: translateY(-1px);
|
|
}
|
|
.error-message {
|
|
margin-top: 16px;
|
|
padding: 12px 14px;
|
|
border-radius: 14px;
|
|
background: rgba(239,68,68,0.08);
|
|
border: 1px solid rgba(239,68,68,0.12);
|
|
color: var(--danger);
|
|
font-size: 14px;
|
|
text-align: center;
|
|
}
|
|
.panel-footer {
|
|
margin-top: 24px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
color: var(--text-soft);
|
|
font-size: 13px;
|
|
}
|
|
.panel-footer .status {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
.panel-footer .dot {
|
|
width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,0.12);
|
|
}
|
|
@media (max-width: 960px) {
|
|
.login-shell { grid-template-columns: 1fr; min-height: auto; }
|
|
.login-showcase { padding: 34px 28px; }
|
|
.hero-title { font-size: 34px; }
|
|
.showcase-metrics { grid-template-columns: 1fr; }
|
|
.login-panel { padding: 32px 24px; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
<div class="login-shell">
|
|
<section class="login-showcase">
|
|
<div class="showcase-top">
|
|
<div class="brand">
|
|
<div class="brand-logo"><img src="/static/logo.png" alt="Logo"></div>
|
|
<div class="brand-copy">
|
|
<strong>A-BOT 控制台</strong>
|
|
<span>Modern Operations Dashboard</span>
|
|
</div>
|
|
</div>
|
|
<div class="hero-copy">
|
|
<div class="hero-eyebrow">Welcome back</div>
|
|
<div class="hero-title">统一管理机器人、消息、插件与系统状态</div>
|
|
<div class="hero-desc">关注机器人信息,了解实时进展</div>
|
|
</div>
|
|
</div>
|
|
<div class="showcase-bottom">
|
|
<div class="showcase-metrics">
|
|
<div class="metric-item"><div class="metric-label">Workspace</div><div class="metric-value">ABOT</div></div>
|
|
<div class="metric-item"><div class="metric-label">Focus</div><div class="metric-value">消息 / 群组</div></div>
|
|
<div class="metric-item"><div class="metric-label">Style</div><div class="metric-value">Modern UI</div></div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="login-panel">
|
|
<div class="login-card">
|
|
<div class="panel-eyebrow">Sign In</div>
|
|
<div class="panel-title">登录后台</div>
|
|
<div class="panel-desc">输入管理员账号信息,进入新版控制台继续处理机器人运营、统计与系统管理工作。</div>
|
|
<el-form class="login-form" ref="loginForm" :model="loginForm" :rules="rules" label-width="0px">
|
|
<el-form-item prop="username">
|
|
<el-input v-model="loginForm.username" prefix-icon="el-icon-user" placeholder="用户名" size="large"></el-input>
|
|
</el-form-item>
|
|
<el-form-item prop="password">
|
|
<el-input v-model="loginForm.password" prefix-icon="el-icon-lock" placeholder="密码" type="password" size="large" @keyup.enter.native="submitForm"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" class="login-button" @click="submitForm" :loading="loading" size="large">登录进入控制台</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div class="error-message" v-if="errorMessage">{{ errorMessage }}</div>
|
|
<div class="panel-footer">
|
|
<span>© 2026 ABOT</span>
|
|
<span class="status"><span class="dot"></span> 安全连接已就绪</span>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
new Vue({
|
|
el: '#app',
|
|
data() {
|
|
return {
|
|
loginForm: { username: '', password: '' },
|
|
rules: {
|
|
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
|
|
password: [{ required: true, message: '请输入密码', trigger: 'blur' }]
|
|
},
|
|
loading: false,
|
|
errorMessage: ''
|
|
}
|
|
},
|
|
methods: {
|
|
submitForm() {
|
|
this.$refs.loginForm.validate((valid) => {
|
|
if (valid) {
|
|
this.loading = true;
|
|
const formData = new FormData();
|
|
formData.append('username', this.loginForm.username);
|
|
formData.append('password', this.loginForm.password);
|
|
fetch('/login', { method: 'POST', body: formData })
|
|
.then(response => {
|
|
if (response.redirected) {
|
|
window.location.href = response.url;
|
|
} else {
|
|
return response.text();
|
|
}
|
|
})
|
|
.then(html => {
|
|
if (html) {
|
|
this.errorMessage = '用户名或密码错误';
|
|
this.loading = false;
|
|
}
|
|
})
|
|
.catch(error => {
|
|
console.error('登录出错:', error);
|
|
this.errorMessage = '登录请求失败,请稍后重试';
|
|
this.loading = false;
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|