diff --git a/web/src/App.vue b/web/src/App.vue index 98240aef..a5615884 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,3 +1,8 @@ + diff --git a/web/src/assets/pics/login_bg.jpg b/web/src/assets/pics/login_bg.jpg new file mode 100644 index 00000000..c958eb8a Binary files /dev/null and b/web/src/assets/pics/login_bg.jpg differ diff --git a/web/src/assets/theme.js b/web/src/assets/theme.js index 6f5c25eb..fa0851f8 100644 --- a/web/src/assets/theme.js +++ b/web/src/assets/theme.js @@ -1,7 +1,14 @@ +// https://www.antdv.com/docs/vue/customize-theme-cn export const themeConfig = { token: { - colorPrimary: '#005F77', - colorInfo: '#191919', - fontFamily: "'HarmonyOS Sans SC', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;" + fontFamily: "'HarmonyOS Sans SC', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;", + colorPrimary: '#1c7796', + colorPrimaryBg: '#d6eef1', + colorInfo: '#0058d4', + colorSuccess: '#45b30e', + colorError: '#c73234', + colorBgBase: '#ffffff', + borderRadius: 8, + wireframe: false, }, } \ No newline at end of file diff --git a/web/src/layouts/AppLayout.vue b/web/src/layouts/AppLayout.vue index 6e325463..a973a149 100644 --- a/web/src/layouts/AppLayout.vue +++ b/web/src/layouts/AppLayout.vue @@ -25,7 +25,6 @@ import { RobotFilled, ApiOutlined, } from '@ant-design/icons-vue' -import { themeConfig } from '@/assets/theme' import { useConfigStore } from '@/stores/config' import { useDatabaseStore } from '@/stores/database' import DebugComponent from '@/components/DebugComponent.vue' @@ -201,14 +200,12 @@ const mainList = [{ 知识 设置 - - diff --git a/web/src/views/LoginView.vue b/web/src/views/LoginView.vue index a7b91325..e36a85ce 100644 --- a/web/src/views/LoginView.vue +++ b/web/src/views/LoginView.vue @@ -1,6 +1,6 @@ @@ -96,6 +142,8 @@ import { useUserStore } from '@/stores/user'; import { message } from 'ant-design-vue'; import { chatApi } from '@/apis/auth_api'; import { authApi } from '@/apis/public_api'; +import { UserOutlined, LockOutlined, WechatOutlined, QrcodeOutlined, ThunderboltOutlined } from '@ant-design/icons-vue'; +import loginBg from '@/assets/pics/login_bg.jpg'; const router = useRouter(); const userStore = useUserStore(); @@ -104,6 +152,7 @@ const userStore = useUserStore(); const isFirstRun = ref(false); const loading = ref(false); const errorMessage = ref(''); +const rememberMe = ref(false); // 登录表单 const loginForm = reactive({ @@ -118,6 +167,11 @@ const adminForm = reactive({ confirmPassword: '' }); +// 开发中功能提示 +const showDevMessage = () => { + message.info('该功能正在开发中,敬请期待!'); +}; + // 密码确认验证 const validateConfirmPassword = (rule, value) => { if (value === '') { @@ -249,15 +303,32 @@ onMounted(async () => { display: flex; justify-content: center; align-items: center; - background-color: #f5f5f5; + background-size: cover; + background-position: center; + position: relative; + + &::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.1); + z-index: 0; + } } .login-container { - width: 400px; + width: 420px; padding: 40px; - background-color: white; - border-radius: 8px; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); + background-color: rgba(255, 255, 255, 0.9); + border-radius: 12px; + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); + position: relative; + z-index: 1; + backdrop-filter: blur(8px); + border: 2px solid white; } .login-logo { @@ -265,24 +336,55 @@ onMounted(async () => { margin-bottom: 30px; img { - height: 60px; + height: 70px; margin-bottom: 16px; } h1 { - font-size: 24px; + font-size: 28px; font-weight: 600; - color: #333; + color: var(--main-color); margin: 0; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); } } .login-form { h2 { text-align: center; - margin-bottom: 24px; - font-size: 20px; + margin-bottom: 30px; + font-size: 22px; font-weight: 500; + color: #333; + } + + :deep(.ant-form-item) { + margin-bottom: 20px; + } + + :deep(.ant-input-affix-wrapper) { + padding: 10px 11px; + height: auto; + } + + :deep(.ant-btn) { + font-size: 16px; + } +} + +.login-options { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 8px; + + .forgot-password { + color: #1890ff; + font-size: 14px; + + &:hover { + color: #40a9ff; + } } } @@ -294,11 +396,83 @@ onMounted(async () => { .error-message { margin-top: 16px; - padding: 8px 12px; + padding: 10px 12px; background-color: #fff2f0; border: 1px solid #ffccc7; border-radius: 4px; color: #ff4d4f; font-size: 14px; } + +.third-party-login { + margin-top: 20px; + + .divider { + position: relative; + text-align: center; + margin: 16px 0; + + &::before, &::after { + content: ''; + position: absolute; + top: 50%; + width: calc(50% - 60px); + height: 1px; + background-color: #e8e8e8; + } + + &::before { + left: 0; + } + + &::after { + right: 0; + } + + span { + display: inline-block; + padding: 0 12px; + background-color: #fff; + position: relative; + color: #999; + font-size: 14px; + } + } + + .login-icons { + display: flex; + justify-content: center; + margin-top: 16px; + + .login-icon { + margin: 0 12px; + width: 42px; + height: 42px; + color: #666; + border: 1px solid var(--gray-300); + transition: all 0.3s; + + &:hover { + color: var(--main-color); + border-color: var(--main-color); + } + } + } +} + +.login-footer { + margin-top: 24px; + text-align: center; + font-size: 13px; + + a { + color: #666; + margin: 0 8px; + cursor: pointer; + + &:hover { + color: var(--main-color); + } + } +} \ No newline at end of file