|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="h-screen w-full flex flex-1 flex-col justify-center items-center overflow-hidden">
|
|
<div class="h-screen w-full flex flex-1 flex-col justify-center items-center overflow-hidden">
|
|
- <div class="login-layout-container bg-[#fff] dark:bg-[#101014]">
|
|
|
|
|
|
+ <div class="login-layout-container overflow-hidden">
|
|
<!-- S LOGO -->
|
|
<!-- S LOGO -->
|
|
<!-- <div class="flex justify-start px-2 fixed" style="top: 32px; left: 36px; cursor: pointer; app-region: no-drag">
|
|
<!-- <div class="flex justify-start px-2 fixed" style="top: 32px; left: 36px; cursor: pointer; app-region: no-drag">
|
|
<div class="logo-text ml-1" style="width: 115px">
|
|
<div class="logo-text ml-1" style="width: 115px">
|
|
@@ -8,54 +8,15 @@
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
</div> -->
|
|
<!-- E LOGO -->
|
|
<!-- E LOGO -->
|
|
- <div class="form-wrapper-content">
|
|
|
|
- <div class="login-main flex flex-col items-center justify-center px-6">
|
|
|
|
- <el-card class="w-440px login-card" body-style="padding: 48px;">
|
|
|
|
- <div class="flex justify-center mt-16px">
|
|
|
|
- <h3 class="text-3xl app-text-fg-high mt-0 mb-24px" style="align-self: flex-start; font-weight: 500">
|
|
|
|
- 欢迎使用 {{ APP_TITLE }}
|
|
|
|
- </h3>
|
|
|
|
- </div>
|
|
|
|
- <el-form ref="formRef" :model="loginForm" :rules="rules" size="large" autocomplete="on">
|
|
|
|
- <el-form-item prop="username">
|
|
|
|
- <el-input v-model="loginForm.username" placeholder="请输入账号">
|
|
|
|
- <template #prefix>
|
|
|
|
- <el-icon class="el-input__icon">
|
|
|
|
- <nova-i-people theme="outline" size="24" />
|
|
|
|
- </el-icon>
|
|
|
|
- </template>
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item prop="password">
|
|
|
|
- <el-input
|
|
|
|
- v-model="loginForm.password"
|
|
|
|
- type="password"
|
|
|
|
- placeholder="请输入密码"
|
|
|
|
- show-password
|
|
|
|
- @keyup.enter="onLoginClick(formRef)"
|
|
|
|
- >
|
|
|
|
- <template #prefix>
|
|
|
|
- <el-icon class="el-input__icon">
|
|
|
|
- <nova-i-lock theme="outline" size="24" />
|
|
|
|
- </el-icon>
|
|
|
|
- </template>
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <div class="flex justify-between">
|
|
|
|
- <div class="flex-initial">
|
|
|
|
- <el-checkbox v-model="autoLogin">自动登录</el-checkbox>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-button type="primary" :loading="loginButLoading" class="w-full" @click="onLoginClick(formRef)">
|
|
|
|
- 登录
|
|
|
|
- </el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- </el-card>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="left absolute left-192px p-r-60px">
|
|
|
|
+ <div class="login-img"></div>
|
|
|
|
+ <User @login="onLoginClick($event)"></User>
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ class="right overflow-hidden absolute right-0 flex flex-1 flex-justify-start h-100% border-0 box-border w-800px border-l border-solid border-l-gray-300"
|
|
|
|
+ >
|
|
|
|
+ <div class="top-img w-250px h-130px absolute top-20px right--20px"></div>
|
|
|
|
+ <div class="bg w-800px h-800px"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -69,41 +30,29 @@ meta:
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
-import type { FormInstance, FormRules } from 'element-plus';
|
|
|
|
|
|
+import type { FormInstance } from 'element-plus';
|
|
import { useUserStore } from '@/stores/modules/user';
|
|
import { useUserStore } from '@/stores/modules/user';
|
|
import { HOME_URL, ST_CONFIG } from '@/config';
|
|
import { HOME_URL, ST_CONFIG } from '@/config';
|
|
-
|
|
|
|
-interface RuleForm {
|
|
|
|
- username: string;
|
|
|
|
- password: string;
|
|
|
|
-}
|
|
|
|
|
|
+import User from './components/user.vue';
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
|
|
|
|
const APP_TITLE = ST_CONFIG.APP_TITLE;
|
|
const APP_TITLE = ST_CONFIG.APP_TITLE;
|
|
|
|
|
|
-// 登录表单
|
|
|
|
-const formRef = ref<FormInstance>();
|
|
|
|
-const loginForm = reactive<RuleForm>({
|
|
|
|
- username: '',
|
|
|
|
- password: ''
|
|
|
|
-});
|
|
|
|
-const rules = reactive<FormRules<RuleForm>>({
|
|
|
|
- username: [{ required: true, message: '请输入账号', trigger: 'blur' }],
|
|
|
|
- password: [{ required: true, message: '请输入密码', trigger: 'blur' }]
|
|
|
|
-});
|
|
|
|
const autoLogin = ref(false);
|
|
const autoLogin = ref(false);
|
|
const loginButLoading = ref(false);
|
|
const loginButLoading = ref(false);
|
|
|
|
|
|
// 登录
|
|
// 登录
|
|
const onLoginClick = async (formEl: FormInstance | undefined) => {
|
|
const onLoginClick = async (formEl: FormInstance | undefined) => {
|
|
|
|
+ console.log(formEl, 'ss');
|
|
|
|
+
|
|
if (!formEl) return;
|
|
if (!formEl) return;
|
|
loginButLoading.value = true;
|
|
loginButLoading.value = true;
|
|
await formEl.validate(valid => {
|
|
await formEl.validate(valid => {
|
|
loginButLoading.value = false;
|
|
loginButLoading.value = false;
|
|
if (valid) {
|
|
if (valid) {
|
|
- userStore.setToken('nova-token');
|
|
|
|
|
|
+ userStore.setToken('st-token');
|
|
router.push(HOME_URL);
|
|
router.push(HOME_URL);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -111,21 +60,53 @@ const onLoginClick = async (formEl: FormInstance | undefined) => {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scope>
|
|
<style lang="scss" scope>
|
|
-.login-layout-container {
|
|
|
|
- position: relative;
|
|
|
|
|
|
+// @media screen and (max-width: 1920px) {
|
|
|
|
+// login-layout-container {
|
|
|
|
+// transform: scale(0.8);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+.left {
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
- align-content: center;
|
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
|
+ height: 100%;
|
|
|
|
+ .input {
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.right {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ .top-img {
|
|
|
|
+ background: url('@/assets/login/login1.png') no-repeat center 100%/100%;
|
|
|
|
+ // width: 350px;
|
|
|
|
+ // height: 210px;
|
|
|
|
+ // position: absolute;
|
|
|
|
+ // right: -100px;
|
|
|
|
+ // top: 20px;
|
|
|
|
+ }
|
|
|
|
+ .bg {
|
|
|
|
+ background: url('@/assets/login/bg.png') no-repeat center 100%/100%;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.login-img {
|
|
|
|
+ background: url('@/assets/login/login2.png') no-repeat center 100%/100%;
|
|
|
|
+ width: 300.49px;
|
|
|
|
+ height: 208.5px;
|
|
|
|
+}
|
|
|
|
+.login-layout-container {
|
|
|
|
+ position: relative;
|
|
|
|
+ display: flex;
|
|
|
|
+ // flex-direction: column;
|
|
|
|
+ // align-content: center;
|
|
|
|
+ // justify-content: center;
|
|
width: 100vw;
|
|
width: 100vw;
|
|
height: 100vh;
|
|
height: 100vh;
|
|
overflow: auto;
|
|
overflow: auto;
|
|
- background-image: url('@/assets/images/bg.svg');
|
|
|
|
- background-size: cover;
|
|
|
|
- background-position: center center;
|
|
|
|
- background-repeat: no-repeat;
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+.Wd-login {
|
|
|
|
+ width: 470px;
|
|
|
|
+}
|
|
.logo-text {
|
|
.logo-text {
|
|
color: #c2cad1;
|
|
color: #c2cad1;
|
|
}
|
|
}
|
|
@@ -134,25 +115,17 @@ const onLoginClick = async (formEl: FormInstance | undefined) => {
|
|
-webkit-app-region: no-drag;
|
|
-webkit-app-region: no-drag;
|
|
}
|
|
}
|
|
.login-main {
|
|
.login-main {
|
|
- margin: 0 auto;
|
|
|
|
|
|
+ // margin: 0 auto;
|
|
-webkit-app-region: no-drag;
|
|
-webkit-app-region: no-drag;
|
|
}
|
|
}
|
|
|
|
|
|
.dark .login-card {
|
|
.dark .login-card {
|
|
- border: 1px solid #272835;
|
|
|
|
- box-shadow:
|
|
|
|
- rgba(22, 14, 45, 0.02) 0px 0px 40px,
|
|
|
|
- rgba(22, 14, 45, 0.06) 0px 0px 104px !important;
|
|
|
|
- border-radius: 8px;
|
|
|
|
- background: #191a23;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
.login-card {
|
|
.login-card {
|
|
- border: 1px solid #eaecf0;
|
|
|
|
- box-shadow:
|
|
|
|
- rgba(22, 14, 45, 0.02) 0px 0px 40px,
|
|
|
|
- rgba(22, 14, 45, 0.06) 0px 0px 104px !important;
|
|
|
|
- border-radius: 8px;
|
|
|
|
- background: #fff;
|
|
|
|
|
|
+}
|
|
|
|
+::v-deep(.el-input) {
|
|
|
|
+ border: 1px solid rgba(1, 1, 1, 0.3);
|
|
|
|
+ border-radius: 48px !important;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|