Add Aliyun SMS settings and refresh admin login
This commit is contained in:
@@ -233,6 +233,54 @@ const systemSettingSections: SystemSettingSection[] = [
|
||||
placeholder: "例如 123456",
|
||||
description: "mock 短信开启时使用的固定验证码。",
|
||||
},
|
||||
{
|
||||
key: "aliyun_sms_access_key_id",
|
||||
label: "阿里云 AccessKey ID",
|
||||
type: "password",
|
||||
defaultValue: "",
|
||||
placeholder: "请输入 RAM 用户 AccessKey ID",
|
||||
description: "关闭 mock 短信后用于调用阿里云短信服务。",
|
||||
},
|
||||
{
|
||||
key: "aliyun_sms_access_key_secret",
|
||||
label: "阿里云 AccessKey Secret",
|
||||
type: "password",
|
||||
defaultValue: "",
|
||||
placeholder: "请输入 RAM 用户 AccessKey Secret",
|
||||
description: "敏感配置,建议使用最小权限 RAM 用户。",
|
||||
},
|
||||
{
|
||||
key: "aliyun_sms_sign_name",
|
||||
label: "阿里云短信签名",
|
||||
type: "text",
|
||||
defaultValue: "",
|
||||
placeholder: "例如 某某课堂",
|
||||
description: "需与阿里云短信控制台审核通过的签名一致。",
|
||||
},
|
||||
{
|
||||
key: "aliyun_sms_template_code",
|
||||
label: "阿里云模板 Code",
|
||||
type: "text",
|
||||
defaultValue: "",
|
||||
placeholder: "例如 SMS_123456789",
|
||||
description: "验证码短信模板 Code。",
|
||||
},
|
||||
{
|
||||
key: "aliyun_sms_template_param_key",
|
||||
label: "验证码变量名",
|
||||
type: "text",
|
||||
defaultValue: "code",
|
||||
placeholder: "默认 code",
|
||||
description: "模板中验证码变量名,例如模板变量为 ${code} 时填写 code。",
|
||||
},
|
||||
{
|
||||
key: "aliyun_sms_endpoint",
|
||||
label: "阿里云短信 Endpoint",
|
||||
type: "text",
|
||||
defaultValue: "dysmsapi.aliyuncs.com",
|
||||
placeholder: "dysmsapi.aliyuncs.com",
|
||||
description: "一般保持默认值即可。",
|
||||
},
|
||||
{
|
||||
key: "default_user_name_prefix",
|
||||
label: "默认用户名前缀",
|
||||
@@ -984,19 +1032,41 @@ function buildChatQuery() {
|
||||
|
||||
<template>
|
||||
<main v-if="!admin" class="login-page">
|
||||
<section class="login-box">
|
||||
<div class="brand">AI</div>
|
||||
<h1>AI 知识库后台</h1>
|
||||
<p>用于维护用户、知识库、Agent、模型和审计记录。</p>
|
||||
<el-form label-position="top" @submit.prevent="login">
|
||||
<el-form-item label="管理员账号">
|
||||
<el-input v-model="loginForm.username" />
|
||||
</el-form-item>
|
||||
<el-form-item label="密码">
|
||||
<el-input v-model="loginForm.password" type="password" show-password />
|
||||
</el-form-item>
|
||||
<el-button type="primary" :loading="loading" class="full-btn" @click="login">登录</el-button>
|
||||
</el-form>
|
||||
<section class="login-hero">
|
||||
<div class="login-hero-main">
|
||||
<div class="login-brand">
|
||||
<span>AI</span>
|
||||
<strong>知识库管理后台</strong>
|
||||
</div>
|
||||
<h1>让知识库、Agent 和用户运营保持在同一个控制台里。</h1>
|
||||
<p>统一维护学员、知识库、模型配置、问答记录和系统运行参数,方便排查与交接。</p>
|
||||
<div class="login-highlights">
|
||||
<span>知识库运营</span>
|
||||
<span>Agent 调试</span>
|
||||
<span>记录审计</span>
|
||||
</div>
|
||||
</div>
|
||||
<section class="login-card">
|
||||
<div class="login-card-head">
|
||||
<h2>管理员登录</h2>
|
||||
<p>请输入后台管理员账号和密码。</p>
|
||||
</div>
|
||||
<el-form label-position="top" @submit.prevent="login">
|
||||
<el-form-item label="管理员账号">
|
||||
<el-input v-model="loginForm.username" size="large" placeholder="请输入管理员账号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="密码">
|
||||
<el-input
|
||||
v-model="loginForm.password"
|
||||
size="large"
|
||||
type="password"
|
||||
placeholder="请输入密码"
|
||||
show-password
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-button type="primary" :loading="loading" class="full-btn login-submit" @click="login">登录后台</el-button>
|
||||
</el-form>
|
||||
</section>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
|
||||
@@ -23,32 +23,146 @@ textarea {
|
||||
|
||||
.login-page {
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
background: #eef4f2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 48px;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(15, 115, 93, 0.14), rgba(234, 179, 8, 0.08)),
|
||||
#f4f7f6;
|
||||
}
|
||||
|
||||
.login-box {
|
||||
width: 380px;
|
||||
padding: 32px;
|
||||
.login-hero {
|
||||
width: min(1080px, 100%);
|
||||
min-height: 620px;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.1fr) 420px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #dce6e2;
|
||||
border-radius: 8px;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 18px 44px rgba(35, 54, 49, 0.08);
|
||||
box-shadow: 0 24px 70px rgba(31, 45, 42, 0.12);
|
||||
}
|
||||
|
||||
.login-hero-main {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 48px;
|
||||
background: #12352e;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.login-hero-main::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
right: 42px;
|
||||
bottom: 42px;
|
||||
width: 280px;
|
||||
height: 280px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.14);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.login-brand {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.login-brand span,
|
||||
.brand {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
margin-bottom: 18px;
|
||||
border-radius: 8px;
|
||||
background: #0f8b6f;
|
||||
color: #ffffff;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.login-brand span {
|
||||
background: #eab308;
|
||||
color: #17231f;
|
||||
}
|
||||
|
||||
.login-brand strong {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.login-hero-main h1 {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
max-width: 620px;
|
||||
margin: 72px 0 0;
|
||||
font-size: 40px;
|
||||
line-height: 1.18;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.login-hero-main p {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
max-width: 560px;
|
||||
margin: 18px 0 0;
|
||||
color: rgba(255, 255, 255, 0.74);
|
||||
font-size: 16px;
|
||||
line-height: 1.75;
|
||||
}
|
||||
|
||||
.login-highlights {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.login-highlights span {
|
||||
padding: 8px 12px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.18);
|
||||
border-radius: 6px;
|
||||
color: rgba(255, 255, 255, 0.82);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.login-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding: 48px;
|
||||
}
|
||||
|
||||
.login-card-head {
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
.login-card h2 {
|
||||
margin: 0;
|
||||
color: #132822;
|
||||
font-size: 28px;
|
||||
line-height: 1.25;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.login-card p {
|
||||
margin: 8px 0 0;
|
||||
color: #667a73;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.login-submit {
|
||||
height: 44px;
|
||||
margin-top: 4px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.login-box h1,
|
||||
.page-head h2 {
|
||||
margin: 0;
|
||||
@@ -809,9 +923,33 @@ textarea {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.login-box {
|
||||
width: min(380px, calc(100vw - 32px));
|
||||
padding: 24px;
|
||||
.login-page {
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.login-hero {
|
||||
min-height: auto;
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.login-hero-main {
|
||||
padding: 28px;
|
||||
}
|
||||
|
||||
.login-hero-main::after {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
right: 18px;
|
||||
bottom: 18px;
|
||||
}
|
||||
|
||||
.login-hero-main h1 {
|
||||
margin-top: 42px;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.login-card {
|
||||
padding: 28px;
|
||||
}
|
||||
|
||||
.admin-shell {
|
||||
|
||||
Reference in New Issue
Block a user