登录页增加logo
This commit is contained in:
@@ -1,54 +1,34 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
|
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
|
||||||
<h3 class="title">{{ title }}</h3>
|
<div class="logo-box">
|
||||||
|
<img v-if="logo" :src="logo" class="logo" />
|
||||||
|
<h3 class="title">{{ title }}</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input
|
<el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" placeholder="账号">
|
||||||
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>
|
<template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<el-input
|
<el-input v-model="loginForm.password" type="password" size="large" auto-complete="off" placeholder="密码"
|
||||||
v-model="loginForm.password"
|
@keyup.enter="handleLogin">
|
||||||
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>
|
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="code" v-if="captchaEnabled">
|
<el-form-item prop="code" v-if="captchaEnabled">
|
||||||
<el-input
|
<el-input v-model="loginForm.code" size="large" auto-complete="off" placeholder="验证码" style="width: 63%"
|
||||||
v-model="loginForm.code"
|
@keyup.enter="handleLogin">
|
||||||
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>
|
<template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<div class="login-code">
|
<div class="login-code">
|
||||||
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
|
<img :src="codeUrl" @click="getCode" class="login-code-img" />
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
|
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
|
||||||
<el-form-item style="width:100%;">
|
<el-form-item style="width:100%;">
|
||||||
<el-button
|
<el-button :loading="loading" size="large" type="primary" style="width:100%;" @click.prevent="handleLogin">
|
||||||
:loading="loading"
|
|
||||||
size="large"
|
|
||||||
type="primary"
|
|
||||||
style="width:100%;"
|
|
||||||
@click.prevent="handleLogin"
|
|
||||||
>
|
|
||||||
<span v-if="!loading">登 录</span>
|
<span v-if="!loading">登 录</span>
|
||||||
<span v-else>登 录 中...</span>
|
<span v-else>登 录 中...</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -70,7 +50,7 @@ import Cookies from "js-cookie"
|
|||||||
import { encrypt, decrypt } from "@/utils/jsencrypt"
|
import { encrypt, decrypt } from "@/utils/jsencrypt"
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import defaultSettings from '@/settings'
|
import defaultSettings from '@/settings'
|
||||||
|
import logo from '@/assets/logo/logo.jpg'
|
||||||
const title = import.meta.env.VITE_APP_TITLE
|
const title = import.meta.env.VITE_APP_TITLE
|
||||||
const footerContent = defaultSettings.footerContent
|
const footerContent = defaultSettings.footerContent
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -101,7 +81,7 @@ const register = ref(false)
|
|||||||
const redirect = ref(undefined)
|
const redirect = ref(undefined)
|
||||||
|
|
||||||
watch(route, (newRoute) => {
|
watch(route, (newRoute) => {
|
||||||
redirect.value = newRoute.query && newRoute.query.redirect
|
redirect.value = newRoute.query && newRoute.query.redirect
|
||||||
}, { immediate: true })
|
}, { immediate: true })
|
||||||
|
|
||||||
function handleLogin() {
|
function handleLogin() {
|
||||||
@@ -175,7 +155,6 @@ getCookie()
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
.title {
|
.title {
|
||||||
margin: 0px auto 30px auto;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #1b222f;
|
color: #1b222f;
|
||||||
font-weight:500;
|
font-weight:500;
|
||||||
@@ -189,7 +168,19 @@ getCookie()
|
|||||||
width: 400px;
|
width: 400px;
|
||||||
padding: 25px 25px 5px 25px;
|
padding: 25px 25px 5px 25px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
.el-button:hover{
|
.logo-box {
|
||||||
|
display: flex;
|
||||||
|
margin: 0px auto 30px auto;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-button:hover {
|
||||||
background-color: RGB(0, 145, 145);
|
background-color: RGB(0, 145, 145);
|
||||||
}
|
}
|
||||||
.el-input {
|
.el-input {
|
||||||
|
|||||||
Reference in New Issue
Block a user