|
|
|
|
@ -3,52 +3,28 @@
|
|
|
|
|
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
|
|
|
|
|
<h3 class="title">后台管理系统</h3>
|
|
|
|
|
<el-form-item prop="username">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="loginForm.username"
|
|
|
|
|
type="text"
|
|
|
|
|
size="large"
|
|
|
|
|
auto-complete="off"
|
|
|
|
|
placeholder="账号"
|
|
|
|
|
>
|
|
|
|
|
<el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" placeholder="账号">
|
|
|
|
|
<template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item prop="password">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="loginForm.password"
|
|
|
|
|
type="password"
|
|
|
|
|
size="large"
|
|
|
|
|
auto-complete="off"
|
|
|
|
|
placeholder="密码"
|
|
|
|
|
@keyup.enter="handleLogin"
|
|
|
|
|
>
|
|
|
|
|
<el-input v-model="loginForm.password" type="password" size="large" auto-complete="off" placeholder="密码"
|
|
|
|
|
@keyup.enter="handleLogin">
|
|
|
|
|
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item prop="code" v-if="captchaEnabled">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="loginForm.code"
|
|
|
|
|
size="large"
|
|
|
|
|
auto-complete="off"
|
|
|
|
|
placeholder="验证码"
|
|
|
|
|
style="width: 63%"
|
|
|
|
|
@keyup.enter="handleLogin"
|
|
|
|
|
>
|
|
|
|
|
<el-input v-model="loginForm.code" size="large" auto-complete="off" placeholder="验证码" style="width: 63%"
|
|
|
|
|
@keyup.enter="handleLogin">
|
|
|
|
|
<template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template>
|
|
|
|
|
</el-input>
|
|
|
|
|
<div class="login-code">
|
|
|
|
|
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
|
|
|
|
|
<img :src="codeUrl" @click="getCode" class="login-code-img" />
|
|
|
|
|
</div>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
|
|
|
|
|
<el-form-item style="width:100%;">
|
|
|
|
|
<el-button
|
|
|
|
|
:loading="loading"
|
|
|
|
|
size="large"
|
|
|
|
|
type="primary"
|
|
|
|
|
style="width:100%;"
|
|
|
|
|
@click.prevent="handleLogin"
|
|
|
|
|
>
|
|
|
|
|
<el-button :loading="loading" size="large" type="primary" style="width:100%;" @click.prevent="handleLogin">
|
|
|
|
|
<span v-if="!loading">登 录</span>
|
|
|
|
|
<span v-else>登 录 中...</span>
|
|
|
|
|
</el-button>
|
|
|
|
|
@ -61,7 +37,8 @@
|
|
|
|
|
<div class="el-login-footer">
|
|
|
|
|
<span>Copyright © 2023 湖南艾维禄科技有限公司 All Rights Reserved.</span>
|
|
|
|
|
</div>
|
|
|
|
|
<w-bg-1></w-bg-1>
|
|
|
|
|
<w-bg-1 v-if="localStore.loginBg"></w-bg-1>
|
|
|
|
|
<el-switch v-model="localStore.loginBg" class="login-switch" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -71,20 +48,21 @@ import Cookies from "js-cookie";
|
|
|
|
|
import { encrypt, decrypt } from "@/utils/jsencrypt";
|
|
|
|
|
import useUserStore from '@/store/modules/user'
|
|
|
|
|
import WBg1 from "../components/bg/WBg1.vue";
|
|
|
|
|
import {useDynamicTitle} from "@/utils/dynamicTitle"
|
|
|
|
|
import { useDynamicTitle } from "@/utils/dynamicTitle"
|
|
|
|
|
import { onMounted } from "vue";
|
|
|
|
|
import {useSettingsStore,useLocalStore,useSessionStore} from '@/store'
|
|
|
|
|
import { useSettingsStore, useLocalStore, useSessionStore } from '@/store'
|
|
|
|
|
|
|
|
|
|
onMounted(()=>{
|
|
|
|
|
useLocalStore().test="存放在本地中的值"//NOTE: 测试pinia的本地持久化存储
|
|
|
|
|
useSessionStore().test="存放在会话中的值"//NOTE: 测试pinia的会话持久化存储
|
|
|
|
|
useSettingsStore().title="登录"
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
useLocalStore().test = "存放在本地中的值"//NOTE: 测试pinia的本地持久化存储
|
|
|
|
|
useSessionStore().test = "存放在会话中的值"//NOTE: 测试pinia的会话持久化存储
|
|
|
|
|
useSettingsStore().title = "登录"
|
|
|
|
|
useDynamicTitle()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
const localStore = useLocalStore();
|
|
|
|
|
|
|
|
|
|
const loginForm = ref({
|
|
|
|
|
username: "admin",
|
|
|
|
|
@ -168,9 +146,12 @@ getCookie();
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
|
|
background-image: radial-gradient(#2c77bf, #2564a1);
|
|
|
|
|
background-size: cover;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
margin: 0px auto 30px auto;
|
|
|
|
|
text-align: center;
|
|
|
|
|
@ -181,40 +162,54 @@ getCookie();
|
|
|
|
|
letter-spacing: .3rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.login-switch {
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 11;
|
|
|
|
|
right: 1rem;
|
|
|
|
|
bottom: .5rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.login-form {
|
|
|
|
|
position: relative;
|
|
|
|
|
z-index: 10;
|
|
|
|
|
border-radius: .7rem;
|
|
|
|
|
background-image: linear-gradient(to bottom, #FFF,#FFF,#ddd);
|
|
|
|
|
background-image: linear-gradient(to bottom, #FFF, #FFF, #ddd);
|
|
|
|
|
width: 400px;
|
|
|
|
|
padding: 25px 25px 5px 25px;
|
|
|
|
|
box-shadow: 0 0 5rem #0005, 0 0 .5rem #FFF inset;
|
|
|
|
|
|
|
|
|
|
.el-input {
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
|
|
|
|
input {
|
|
|
|
|
height: 40px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.input-icon {
|
|
|
|
|
height: 39px;
|
|
|
|
|
width: 14px;
|
|
|
|
|
margin-left: 0px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.login-tip {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #bfbfbf;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.login-code {
|
|
|
|
|
width: 33%;
|
|
|
|
|
height: 40px;
|
|
|
|
|
float: right;
|
|
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-login-footer {
|
|
|
|
|
height: 40px;
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
@ -222,11 +217,13 @@ getCookie();
|
|
|
|
|
bottom: 0;
|
|
|
|
|
width: 100%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #fff;
|
|
|
|
|
font-family: Arial;
|
|
|
|
|
color: #ddd;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
letter-spacing: 1px;
|
|
|
|
|
text-shadow: 1px 1px 0 #0009;
|
|
|
|
|
z-index: 10;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.login-code-img {
|
|
|
|
|
height: 40px;
|
|
|
|
|
padding-left: 12px;
|
|
|
|
|
|