登录页面登录跳转修改,首页数据页面绘制

This commit is contained in:
zzyuan 2025-12-26 09:29:18 +08:00
parent 4f7de8bd9f
commit 30e9871d7a
23 changed files with 1241 additions and 852 deletions

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>canteen2.ico"> <link rel="icon" href="<%= BASE_URL %>logo2.ico">
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]--> <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<script src="./monitor/codebase/jsPlugin-1.2.0.min.js"></script> <script src="./monitor/codebase/jsPlugin-1.2.0.min.js"></script>

BIN
public/logo2.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 KiB

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -19,10 +19,10 @@
transition: width 0.28s; transition: width 0.28s;
width: $base-sidebar-width !important; width: $base-sidebar-width !important;
background-color: $base-menu-background; background-color: $base-menu-background;
height: 90%; height: 92%;
position: absolute; position: absolute;
font-size: 0px; font-size: 0px;
top: 84px; top: 68px;
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: 1001; z-index: 1001;

View File

@ -29,7 +29,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.app-main { .app-main {
/* 50= navbar 50 */ /* 50= navbar 50 */
max-height: 85vh; max-height: 87vh;
// overflow-y: auto; // overflow-y: auto;
width: 100%; width: 100%;
position: relative; position: relative;
@ -43,12 +43,12 @@ export default {
.hasTagsView { .hasTagsView {
.app-main { .app-main {
/* 84 = navbar + tags-view = 50 + 34 */ /* 84 = navbar + tags-view = 50 + 34 */
max-height: 85vh; max-height: 87vh;
overflow-y: auto; overflow-y: auto;
} }
.fixed-header + .app-main { .fixed-header + .app-main {
padding-top: 84px; padding-top: 68px;
} }
} }
</style> </style>

View File

@ -2,7 +2,7 @@
<div class="navbar"> <div class="navbar">
<!-- <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> --> <!-- <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> -->
<!-- <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/> --> <!-- <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/> -->
<div style="position: absolute;left: 0;top: 20px;width: 15%;"> <div style="position: absolute;left: 0;top: 10px;width: 15%;">
<router-link key="collapse" class="sidebar-logo-link" to="/"> <router-link key="collapse" class="sidebar-logo-link" to="/">
<!-- <div style="height: 42px;width: 42px;background: #fff;border-radius: 50%;margin-right: 20px;display: flex;align-items: center;justify-content: center;"> <!-- <div style="height: 42px;width: 42px;background: #fff;border-radius: 50%;margin-right: 20px;display: flex;align-items: center;justify-content: center;">
<img :src="logo" class="sidebar-logo" /> <img :src="logo" class="sidebar-logo" />
@ -118,7 +118,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.navbar { .navbar {
height: 84px; height: 68px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
background: #006F68; background: #006F68;

View File

@ -27,7 +27,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="top-view"> <div class="top-view">
<div class="flex-between" style="width: 80%;margin: 6px auto;"> <div class="flex-between" style="width: 80%;margin: 6px auto;">
<span>港澳通行证</span><span>共计 {{statistics.hMCardNum}} </span> <span>港澳通行证</span><span>共计 {{statistics.hmcardNum}} </span>
</div> </div>
<div class="flex-between" style="width: 80%;margin: 6px auto;"> <div class="flex-between" style="width: 80%;margin: 6px auto;">
<span>已借出 {{statistics.outHMCardNum}}</span><span>待入库 {{statistics.inHMCardNum}}</span> <span>已借出 {{statistics.outHMCardNum}}</span><span>待入库 {{statistics.inHMCardNum}}</span>

File diff suppressed because it is too large Load Diff

View File

@ -1,206 +1,483 @@
<template> <template>
<div class="login"> <div class="container">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <div class="login">
<h3 class="title">公职人员护照管理系统</h3> <div class="login-form-box" style="width: 60%;">
<el-form-item prop="username"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" >
<el-input <h3 class="title">欢迎登录</h3>
v-model="loginForm.username" <template v-if="loginMethod === 'password'">
type="text" <el-form-item prop="username">
auto-complete="off" <el-input
placeholder="账号" v-model="loginForm.username"
> type="text" around
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" /> auto-complete="off"
</el-input> :placeholder="`用户名${config.loginConfig.phonePassword ? '/手机号' : ''}${config.loginConfig.emailPassword ? '/邮箱' : ''}`"
</el-form-item> >
<el-form-item prop="password"> <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon"/>
<el-input </el-input>
v-model="loginForm.password" </el-form-item>
type="password" <el-form-item prop="password">
auto-complete="off" <el-input
placeholder="密码" v-model="loginForm.password"
@keyup.enter.native="handleLogin" type="password"
> auto-complete="off"
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" /> placeholder="密码" show-password
</el-input> @keyup.enter.native="handleLogin"
</el-form-item> >
<el-form-item prop="code" v-if="captchaEnabled"> <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon"/>
<el-input </el-input>
v-model="loginForm.code" </el-form-item>
auto-complete="off" <el-form-item prop="code" v-if="captchaEnabled">
placeholder="验证码" <el-input
style="width: 63%" v-model="loginForm.code"
@keyup.enter.native="handleLogin" auto-complete="off"
> placeholder="验证码"
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" /> style="width: 63%"
</el-input> @keyup.enter.native="handleLogin"
<div class="login-code"> >
<img :src="codeUrl" @click="getCode" class="login-code-img"/> <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon"/>
</div> </el-input>
</el-form-item> <div class="login-code">
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox> <img :src="codeUrl" @click="getCode" class="login-code-img"/>
<el-form-item style="width:100%;"> </div>
<el-button </el-form-item>
:loading="loading" <el-form-item v-show="isAdmin" prop="verificationCode">
size="medium" <el-input v-model="loginForm.verificationCode" placeholder="请输入验证码">
type="primary" <template slot="append">
style="width:100%;" <el-button
@click.native.prevent="handleLogin" type="primary"
> @click="sendAdminCode"
<span v-if="!loading"> </span> :disabled="isSendingCode || captchaEnabled?!loginForm.code:false"
<span v-else> 中...</span> class="send-code-button"
</el-button> >
<div style="float: right;" v-if="register"> {{ countdown === 0 ? '获取验证码' : `${countdown}s` }}
<router-link class="link-type" :to="'/register'">立即注册</router-link> </el-button>
</div> </template>
</el-form-item> <svg-icon slot="prefix" icon-class="message" class="el-input__icon input-icon"/>
</el-form> </el-input>
<!-- 底部 --> </el-form-item>
<div class="el-login-footer"> </template>
<span>Copyright © 2018-2024 bonus.vip All Rights Reserved.</span> <template v-else>
<el-form-item prop="mobile">
<el-input
v-model="loginForm.mobile"
type="text"
auto-complete="off"
:placeholder="`${config.loginConfig.phoneCode ? '手机号' : '/'}${config.loginConfig.emailCode ? '邮箱' : ''}`"
>
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon"/>
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="captchaEnabled">
<el-input
v-model="loginForm.code"
auto-complete="off"
placeholder="验证码"
style="width: 63%"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon"/>
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
</div>
</el-form-item>
<el-form-item prop="verificationCode">
<el-input v-model="loginForm.verificationCode" placeholder="请输入验证码">
<template slot="append">
<el-button
type="primary"
@click="sendCode"
:disabled="isSendingCode || captchaEnabled?!loginForm.code:false"
class="send-code-button"
>
{{ countdown === 0 ? '获取验证码' : `${countdown}s` }}
</el-button>
</template>
<svg-icon slot="prefix" icon-class="message" class="el-input__icon input-icon"/>
</el-input>
</el-form-item>
</template>
<div class="login-form-center">
<el-link v-if="config.loginConfig.emailCode ||config.loginConfig.phoneCode " @click="toggleLoginMethod">
{{ loginMethod === 'password' ? '短信登录' : '密码登录' }}
</el-link>
<div></div>
<!-- <router-link v-if="config.registersConfig.emailRegisters || config.registersConfig.phoneRegisters" to="/register">
<el-link>注册账号</el-link>
</router-link> -->
<el-checkbox v-model="loginForm.rememberMe">记住密码</el-checkbox>
</div>
<el-form-item style="width: 100%;">
<el-button v-if="!isAdmin"
:loading="loading"
size="medium"
type="primary"
style="width: 100%;margin-bottom: 20px;"
@click="loginMethod === 'password' ?IsAdmin():handleLogin()"
>
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
<el-button v-if="isAdmin"
:loading="loading"
size="medium"
type="primary"
style="width: 100%;margin-bottom: 20px;"
@click="handleLogin()"
>
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
<router-link v-if="config.registersConfig.emailRegisters || config.registersConfig.phoneRegisters" to="/register">
<el-button size="medium" type="normal" style="width: 100%;" >
<span>注册</span>
</el-button>
</router-link>
</el-form-item>
</el-form>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getCodeImg } from "@/api/login"; import { getCodeImg } from '@/api/login'
import Cookies from "js-cookie"; import Cookies from 'js-cookie'
import { encrypt, decrypt } from '@/utils/jsencrypt' import { decrypt, encrypt } from '@/utils/jsencrypt'
import dingding from '@/assets/images/dingding.svg'
import wx from '@/assets/images/wx.svg'
import qq from '@/assets/images/QQ.svg'
import { decryptWithSM4,encryptWithSM4 } from '@/utils/sm';
export default { export default {
name: "Login", name: 'Login',
data() { data() {
return { return {
codeUrl: "", dingding: dingding,
wx: wx,
qq: qq,
codeUrl: '',
isAdmin: false,
loginForm: { loginForm: {
username: "", username: '',
password: "", password: '',
rememberMe: false, rememberMe: false,
code: "", code: '',
uuid: "" mobile: '',
verificationCode: '',
uuid: '',
loginType: '',
phoneUuid: '',
mobileCodeType: 'LOGIN'
}, },
loginRules: { passwordLoginRules: {
username: [ username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }],
{ required: true, trigger: "blur", message: "请输入您的账号" } password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }],
], code: [{ required: true, trigger: 'change', message: '请输入验证码' }]
password: [ },
{ required: true, trigger: "blur", message: "请输入您的密码" } mobileLoginRules: {
], mobile: [{ required: true, trigger: 'blur', message: '请输入您的手机号' }],
code: [{ required: true, trigger: "change", message: "请输入验证码" }] verificationCode: [{ required: true, trigger: 'blur', message: '请输入验证码' }]
}, },
loading: false, loading: false,
//
captchaEnabled: true, captchaEnabled: true,
// redirect: undefined,
register: false, isSendingCode: false,
redirect: undefined countdown: 0,
}; loginMethod: 'password', // 'password' or 'mobile'
supportsPhoneLogin: false,
supportsEmailLogin: false
}
},
computed: {
config() {
return JSON.parse(localStorage.getItem('systemConfig')) || {loginConfig:{
phonePassword: true,
emailPassword: true,
phoneCode: false,
emailCode: false
},registersConfig: {
phoneRegisters: true,
emailRegisters: true
}}; // JSON
},
loginRules() {
return this.loginMethod === 'password' ? this.passwordLoginRules : this.mobileLoginRules
}
}, },
watch: { watch: {
$route: { $route: {
handler: function(route) { handler(route) {
this.redirect = route.query && route.query.redirect; this.redirect = route.query && route.query.redirect
}, },
immediate: true immediate: true
} }
}, },
created() { created() {
this.getCode(); this.getCode()
this.getCookie(); this.getCookie()
}, },
methods: { methods: {
getCode() { getCode() {
getCodeImg().then(res => { getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled; this.captchaEnabled = res.captchaEnabled !== undefined ? res.captchaEnabled : true
if (this.captchaEnabled) { if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img; this.codeUrl = 'data:image/gif;base64,' + res.img
this.loginForm.uuid = res.uuid; this.loginForm.uuid = res.uuid
} }
}); })
}, },
getCookie() { getCookie() {
const username = Cookies.get("username"); const username = Cookies.get('username')
const password = Cookies.get("password"); const password = Cookies.get('password')
const rememberMe = Cookies.get('rememberMe') const rememberMe = Cookies.get('rememberMe')
this.loginForm = { this.loginForm.username = username || ''
username: username === undefined ? this.loginForm.username : username, this.loginForm.password = password ? decrypt(password) : ''
password: password === undefined ? this.loginForm.password : decrypt(password), this.loginForm.rememberMe = rememberMe === 'true'
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
};
}, },
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate(valid => {
if (valid) { if (valid) {
this.loading = true; this.loading = true
if (this.loginForm.rememberMe) { if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 }); Cookies.set('username', this.loginForm.username, { expires: 30 })
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 }); Cookies.set('password', encrypt(this.loginForm.password), { expires: 30 })
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 }); Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 })
} else { } else {
Cookies.remove("username"); Cookies.remove('username')
Cookies.remove("password"); Cookies.remove('password')
Cookies.remove('rememberMe'); Cookies.remove('rememberMe')
} }
this.$store.dispatch("Login", this.loginForm).then(() => { this.loginForm.loginMethod = this.loginMethod
this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); this.$store.dispatch('Login', this.loginForm)
}).catch(() => { .then(res => {
this.loading = false; this.loading = false
if (this.captchaEnabled) { // console.log(res)
this.getCode(); if (res.code===200){
} if (res.isLogin){
}); this.$modal.confirm('账号已在其他地方登录是否继续登录!!!!').then(function() {
return this.$router.push({ path: this.redirect || '/index' });
}).then(() => {
this.loading = false
}).catch(() => {
this.loading = false
})
}else {
this.$router.push({ path: this.redirect || '/index' });
}
}
})
.catch(() => {
this.loading = false
if (this.captchaEnabled) this.getCode()
})
} }
}); })
},
IsAdmin() {
this.loginForm.loginMethod = this.loginMethod;
let param = {
...this.loginForm
}
param.username = encryptWithSM4(this.loginForm.username)
param.password = encryptWithSM4(this.loginForm.password)
this.$store.dispatch('IsAdmin', param).then(res => {
if (res.data) {
this.isAdmin = res.data
this.$message.success('检测到您是超级管理账号,需进行手机检验')
} else {
this.handleLogin()
}
})
},
isLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
let that = this
this.loginForm.loginMethod = this.loginMethod
this.$store.dispatch('IsLogin', this.loginForm)
.then(res => {
if (res.data) {
this.$modal.confirm('账号已在其他地方登录是否继续登录!!!!').then(function() {
return that.handleLogin()
}).then(() => {
this.loading = false
}).catch(() => {
this.loading = false
})
} else {
that.handleLogin()
}
})
.catch(() => {
this.loading = false
if (this.captchaEnabled) this.getCode()
})
}
})
},
sendAdminCode() {
this.loginForm.mobile = this.loginForm.username
this.$store.dispatch('GetPhoneCode', this.loginForm)
.then(res => {
if (res.code === 200) {
this.loginForm.phoneUuid = res.data
this.$message.success('验证码发送成功')
this.isSendingCode = true
this.countdown = 60
const timer = setInterval(() => {
this.countdown -= 1
if (this.countdown <= 0) {
clearInterval(timer)
this.isSendingCode = false
}
}, 1000)
}
})
.catch(() => {
this.loading = false
//
if (this.captchaEnabled) {
this.getCode()
}
//
this.isSendingCode = false
this.countdown = 0
})
},
sendCode() {
if (this.captchaEnabled ? !this.loginForm.code : false) {
this.$message.error('请先填写验证码')
return
}
if (!this.loginForm.mobile) {
this.$message.error('请先填写'+this.config.loginConfig.phoneCode ? '手机号' : '/' + this.config.loginConfig.emailCode ? '邮箱' : '')
return
}
this.$store.dispatch('GetPhoneCode', this.loginForm)
.then(() => {
this.isSendingCode = true
this.countdown = 60
const timer = setInterval(() => {
this.countdown -= 1
if (this.countdown <= 0) {
clearInterval(timer)
this.isSendingCode = false
}
}, 1000)
})
.catch(() => {
this.loading = false
//
if (this.captchaEnabled) {
this.getCode()
}
//
this.isSendingCode = false
this.countdown = 0
})
},
toggleLoginMethod() {
this.loginMethod = this.loginMethod === 'password' ? 'mobile' : 'password'
this.loginForm.username = ''
this.loginForm.password = ''
this.loginForm.code = ''
this.loginForm.verificationCode = ''
this.loginForm.loginMethod = ''
this.isAdmin = false
this.getCode()
} }
} }
}; }
</script> </script>
<style rel="stylesheet/scss" lang="scss"> <style lang="scss">
.container {
display: flex;
justify-content: flex-end;
align-items: center;
height: 100%;
width: 100%;
background-image: url("../assets/images/login-bg.png");
background-repeat: no-repeat;
background-size: 100% 100%; /* 确保背景图覆盖整个容器 */
background-position: center center; /* 居中显示背景图 */
}
.login { .login {
width: 44%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image: url("../assets/images/login-background.jpg");
background-size: cover;
}
.title {
margin: 0px auto 30px auto;
text-align: center;
color: #707070;
} }
.title {
margin: 0 auto 30px;
// text-align: center;
color: #2A2B2F;
font-weight: 600;
font-size: 24px;
margin-bottom: 60px;
}
.login-form-box{
border-radius: 6px;
background: #ffffff;
width: 100%;
padding: 25px;
height: 600px;
display: flex;
flex-direction: column;
align-content: center;
justify-content: center ;
}
.login-form { .login-form {
border-radius: 6px; border-radius: 6px;
background: #ffffff; background: #ffffff;
width: 400px; width: 100%;
padding: 25px 25px 5px 25px; padding: 25px;
height: auto;
.el-input { .el-input {
height: 38px; height: 38px;
input { input {
height: 38px; height: 38px;
} }
} }
.input-icon { .input-icon {
height: 39px; height: 39px;
width: 14px; width: 14px;
margin-left: 2px; margin-left: 2px;
} }
.login-form-center {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 1%;
margin-bottom: 12%;
}
} }
.login-tip { .login-tip {
font-size: 13px; font-size: 13px;
text-align: center; text-align: center;
color: #bfbfbf; color: #bfbfbf;
} }
.login-code { .login-code {
width: 33%; width: 33%;
height: 38px;
float: right; float: right;
img { img {
cursor: pointer; cursor: pointer;
vertical-align: middle; vertical-align: middle;
} }
} }
.el-login-footer { .el-login-footer {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
@ -213,7 +490,56 @@ export default {
font-size: 12px; font-size: 12px;
letter-spacing: 1px; letter-spacing: 1px;
} }
.login-code-img { .login-code-img {
height: 38px; height: 38px;
} }
.login-container {
text-align: center;
margin-top: 50px;
}
.login-divider {
display: flex;
align-items: center;
text-align: center;
margin: 20px 0;
}
.login-divider::before,
.login-divider::after {
content: '';
flex: 1;
border-bottom: 1px solid #ccc;
}
.login-divider:not(:empty)::before {
margin-right: .25em;
}
.login-divider:not(:empty)::after {
margin-left: .25em;
}
.login-icons {
display: flex;
justify-content: center;
gap: 20px;
}
.login-icon {
width: 50px;
height: 50px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.login-icon img {
width: 50px;
height: 50px;
}
</style> </style>

View File

@ -1,14 +1,14 @@
<template> <template>
<div class="container"> <div class="container">
<div class="login"> <div class="login">
<div class="login-form" style="width: 450px;"> <div class="login-form-box" style="width: 60%;">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" > <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" >
<h3 class="title">公职人员护照管理系统</h3> <h3 class="title">欢迎登录</h3>
<template v-if="loginMethod === 'password'"> <template v-if="loginMethod === 'password'">
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.username"
type="text" type="text" around
auto-complete="off" auto-complete="off"
:placeholder="`用户名${config.loginConfig.phonePassword ? '/手机号' : ''}${config.loginConfig.emailPassword ? '/邮箱' : ''}`" :placeholder="`用户名${config.loginConfig.phonePassword ? '/手机号' : ''}${config.loginConfig.emailPassword ? '/邮箱' : ''}`"
> >
@ -101,9 +101,10 @@
<el-link v-if="config.loginConfig.emailCode ||config.loginConfig.phoneCode " @click="toggleLoginMethod"> <el-link v-if="config.loginConfig.emailCode ||config.loginConfig.phoneCode " @click="toggleLoginMethod">
{{ loginMethod === 'password' ? '短信登录' : '密码登录' }} {{ loginMethod === 'password' ? '短信登录' : '密码登录' }}
</el-link> </el-link>
<router-link v-if="config.registersConfig.emailRegisters || config.registersConfig.phoneRegisters" to="/register"> <div></div>
<!-- <router-link v-if="config.registersConfig.emailRegisters || config.registersConfig.phoneRegisters" to="/register">
<el-link>注册账号</el-link> <el-link>注册账号</el-link>
</router-link> </router-link> -->
<el-checkbox v-model="loginForm.rememberMe">记住密码</el-checkbox> <el-checkbox v-model="loginForm.rememberMe">记住密码</el-checkbox>
</div> </div>
<el-form-item style="width: 100%;"> <el-form-item style="width: 100%;">
@ -111,7 +112,7 @@
:loading="loading" :loading="loading"
size="medium" size="medium"
type="primary" type="primary"
style="width: 100%;" style="width: 100%;margin-bottom: 20px;"
@click="loginMethod === 'password' ?IsAdmin():handleLogin()" @click="loginMethod === 'password' ?IsAdmin():handleLogin()"
> >
<span v-if="!loading"> </span> <span v-if="!loading"> </span>
@ -121,27 +122,19 @@
:loading="loading" :loading="loading"
size="medium" size="medium"
type="primary" type="primary"
style="width: 100%;" style="width: 100%;margin-bottom: 20px;"
@click="handleLogin()" @click="handleLogin()"
> >
<span v-if="!loading"> </span> <span v-if="!loading"> </span>
<span v-else> 中...</span> <span v-else> 中...</span>
</el-button> </el-button>
</el-form-item> <router-link v-if="config.registersConfig.emailRegisters || config.registersConfig.phoneRegisters" to="/register">
<!-- <el-form-item> <el-button size="medium" type="normal" style="width: 100%;" >
<div class="login-divider">第三方登录</div> <span>注册</span>
<div class="login-icons"> </el-button>
<div class="login-icon"> </router-link>
<img :src="dingding" alt="Weibo">
</div> </el-form-item>
<div class="login-icon">
<img :src="wx" alt="WeChat">
</div>
<div class="login-icon">
<img :src="qq" alt="QQ">
</div>
</div>
</el-form-item> -->
</el-form> </el-form>
</div> </div>
</div> </div>
@ -263,14 +256,14 @@ export default {
if (res.code===200){ if (res.code===200){
if (res.isLogin){ if (res.isLogin){
this.$modal.confirm('账号已在其他地方登录是否继续登录!!!!').then(function() { this.$modal.confirm('账号已在其他地方登录是否继续登录!!!!').then(function() {
return this.$router.push({ path: this.redirect || '/canteen/index' }); return this.$router.push({ path: this.redirect || '/index' });
}).then(() => { }).then(() => {
this.loading = false this.loading = false
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
}) })
}else { }else {
this.$router.push({ path: this.redirect || '/canteen/index' }); this.$router.push({ path: this.redirect || '/index' });
} }
} }
}) })
@ -406,14 +399,14 @@ export default {
align-items: center; align-items: center;
height: 100%; height: 100%;
width: 100%; width: 100%;
background-image: url("../assets/images/logind.jpg"); background-image: url("../assets/images/login-bg.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; /* 确保背景图覆盖整个容器 */ background-size: 100% 100%; /* 确保背景图覆盖整个容器 */
background-position: center center; /* 居中显示背景图 */ background-position: center center; /* 居中显示背景图 */
} }
.login { .login {
width: 50%; width: 44%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -422,18 +415,32 @@ export default {
.title { .title {
margin: 0 auto 30px; margin: 0 auto 30px;
text-align: center; // text-align: center;
color: #707070; color: #2A2B2F;
font-weight: 600;
font-size: 24px;
margin-bottom: 60px;
}
.login-form-box{
border-radius: 6px;
background: #ffffff;
width: 100%;
padding: 25px;
height: 600px;
display: flex;
flex-direction: column;
align-content: center;
justify-content: center ;
} }
.login-form { .login-form {
border-radius: 6px; border-radius: 6px;
background: #ffffff; background: #ffffff;
width: 400px; width: 100%;
padding: 25px; padding: 25px;
height: auto;
.el-input { .el-input {
height: 38px; height: 38px;
input { input {
height: 38px; height: 38px;
@ -451,7 +458,7 @@ export default {
justify-content: space-between; justify-content: space-between;
align-items: flex-start; align-items: flex-start;
padding: 1%; padding: 1%;
margin-bottom: 5%; margin-bottom: 12%;
} }
} }

View File

@ -241,7 +241,7 @@ export default {
}, },
// //
handleClose() { handleClose() {
const obj = { path: "/canteen/monitor/job" }; const obj = { path: "/monitor/job" };
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj);
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@ -270,7 +270,7 @@ export default {
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image: url("../assets/images/bg.png"); background-image: url("../assets/images/login-bg.png");
background-size: cover; background-size: cover;
} }

View File

@ -326,7 +326,7 @@ export default {
}, },
/** 返回按钮操作 */ /** 返回按钮操作 */
handleClose() { handleClose() {
const obj = { path: "/canteen/system/dict" }; const obj = { path: "/system/dict" };
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj);
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */

View File

@ -151,7 +151,7 @@ export default {
}, },
// //
handleClose() { handleClose() {
const obj = { path: "/canteen/system/role" }; const obj = { path: "/system/role" };
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj);
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@ -109,7 +109,7 @@ export default {
}, },
/** 关闭按钮 */ /** 关闭按钮 */
close() { close() {
const obj = { path: "/canteen/system/user" }; const obj = { path: "/system/user" };
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj);
}, },
}, },