修改系统标题

master
yuxiang 2 years ago
parent b11c13bf07
commit 6d34a828f2

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = '亳州高标准农田管理系统'
VUE_APP_TITLE = '高标准农田建设管理系统'
# 开发环境配置
ENV = 'development'

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = '亳州高标准农田管理系统'
VUE_APP_TITLE = '高标准农田建设管理系统'
# 生产环境配置
ENV = 'production'

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = '亳州高标准农田管理系统'
VUE_APP_TITLE = '高标准农田建设管理系统'
NODE_ENV = production

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

@ -19,7 +19,7 @@
margin-left: vw(20);
width: vw(800);
height: vh(66);
background: url(../images/bozhou/logo_title.png);
background: url(../images/bozhou/new_logo_title.png);
background-size: 100% 100%;
}
}

@ -1,184 +1,197 @@
<template>
<div class="system-header">
<div class="system-log">
<div class="icon" @click="toggleSideBar"></div>
<div class="title-img"></div>
</div>
<div class="system-msg">
<!-- <div style="margin-right: 36px">
<div class="system-header">
<div class="system-log">
<div class="icon" @click="toggleSideBar"></div>
<div class="title-img"></div>
</div>
<div class="system-msg">
<!-- <div style="margin-right: 36px">
<el-badge :value="msgCount">
<div class="msg"></div>
</el-badge>
</div> -->
<div class="user">
<div class="userIcon"></div>
<!-- <div class="userName">{{ name }}</div> -->
<el-dropdown>
<span class="el-dropdown-link userName">
{{ nickName }}<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="clickuser"
>个人资料</el-dropdown-item
>
<el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="line"></div>
<div class="sel-system" @click="goSelSystemPath()">
<div class="icon"></div>
<!-- <div class="sel-sysyem-text">系统选择</div> -->
</div>
<!-- <div class="line"></div> -->
<!-- <hamburger
<div class="user">
<div class="userIcon"></div>
<!-- <div class="userName">{{ name }}</div> -->
<el-dropdown>
<span class="el-dropdown-link userName">
{{ nickName }}<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="clickuser">个人资料</el-dropdown-item>
<el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="line"></div>
<div class="sel-system" @click="goSelSystemPath()">
<div class="icon"></div>
<!-- <div class="sel-sysyem-text">系统选择</div> -->
</div>
<!-- <div class="line"></div> -->
<!-- <hamburger
id="hamburger-container"
:is-active="sidebar.opened"
class="hamburger-container"
@toggleClick="toggleSideBar"
/> -->
</div>
</div>
</div>
</div>
</template>
<script>
// import Hamburger from "@/components/Hamburger";
import { mapGetters } from "vuex";
export default {
components: {
// Hamburger,
},
data() {
return {
msgCount: 0,
};
},
computed: {
...mapGetters(["name", "nickName", "sidebar"]),
},
methods: {
//
goSelSystemPath() {
this.$router
.replace({
path: "/home",
})
.catch(() => {});
},
toggleSideBar() {
// this.$store.dispatch("app/toggleSideBar");
},
clickuser() {
this.$router.replace("/user/profile");
},
async logout() {
this.$confirm("确定注销并退出系统吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$store.dispatch("LogOut").then(() => {
this.$router.replace("/login");
});
})
.catch(() => {});
},
},
};
// import Hamburger from "@/components/Hamburger";
import {
mapGetters
} from "vuex";
export default {
components: {
// Hamburger,
},
data() {
return {
msgCount: 0,
};
},
computed: {
...mapGetters(["name", "nickName", "sidebar"]),
},
methods: {
//
goSelSystemPath() {
this.$router
.replace({
path: "/home",
})
.catch(() => {});
},
toggleSideBar() {
// this.$store.dispatch("app/toggleSideBar");
},
clickuser() {
this.$router.replace("/user/profile");
},
async logout() {
this.$confirm("确定注销并退出系统吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$store.dispatch("LogOut").then(() => {
this.$router.replace("/login");
});
})
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped>
.system-header {
display: flex;
align-items: center;
justify-content: space-between;
.system-log {
height: 100%;
display: flex;
align-items: center;
.icon {
cursor: pointer;
margin-left: 30px;
margin-right: 15px;
width: 55px;
height: 50px;
background: url("../../../assets/images/bozhou/logo@2x.png");
background-size: 100% 100%;
}
.title-img {
width: 523px;
height: 40px;
background: url("../../../assets/images/bozhou/systemtitle.png");
background-size: 100% 100%;
}
}
.system-msg {
height: 100%;
display: flex;
align-items: center;
padding-right: 30px;
.msg {
cursor: pointer;
height: 28px;
width: 28px;
background: url("../../../assets/images/bozhou/msg.png");
background-size: 100% 100%;
}
.user {
display: flex;
align-items: center;
.userIcon {
height: 24px;
width: 24px;
background: url("../../../assets/images/bozhou/userName.png");
background-size: 100% 100%;
}
.userName {
cursor: pointer;
font-size: 18px;
font-family: "Alibaba-PuHuiTi-Regular";
font-weight: 400;
color: #f6fef8;
margin-left: 3px;
}
}
.line {
margin: 0 20px;
width: 1px;
height: 23px;
background: #16824b;
box-shadow: 1px 0px 0px 0px rgba(169, 225, 123, 0.43);
}
.sel-system {
cursor: pointer;
display: flex;
align-items: center;
.icon {
height: 24px;
width: 24px;
background: url("../../../assets/images/bozhou/selSystem.png");
background-size: 100% 100%;
margin-right: 3px;
}
}
}
}
.sel-sysyem-text {
font-size: 16px;
font-family: "Alibaba-PuHuiTi-Regular";
font-weight: 400;
color: #f6fef8;
}
::v-deep .el-dropdown {
}
::v-deep .el-dropdown-menu__item:not(.is-disabled):hover {
color: #51af5c;
}
.hamburger-container {
line-height: 30px;
height: 34px;
}
.system-header {
display: flex;
align-items: center;
justify-content: space-between;
.system-log {
height: 100%;
display: flex;
align-items: center;
.icon {
cursor: pointer;
margin-left: 30px;
margin-right: 15px;
width: 55px;
height: 50px;
background: url("../../../assets/images/bozhou/logo@2x.png");
background-size: 100% 100%;
}
.title-img {
width: 523px;
height: 40px;
background: url("../../../assets/images/bozhou/systemtitle_new.png");
background-size: 100% 100%;
}
}
.system-msg {
height: 100%;
display: flex;
align-items: center;
padding-right: 30px;
.msg {
cursor: pointer;
height: 28px;
width: 28px;
background: url("../../../assets/images/bozhou/msg.png");
background-size: 100% 100%;
}
.user {
display: flex;
align-items: center;
.userIcon {
height: 24px;
width: 24px;
background: url("../../../assets/images/bozhou/userName.png");
background-size: 100% 100%;
}
.userName {
cursor: pointer;
font-size: 18px;
font-family: "Alibaba-PuHuiTi-Regular";
font-weight: 400;
color: #f6fef8;
margin-left: 3px;
}
}
.line {
margin: 0 20px;
width: 1px;
height: 23px;
background: #16824b;
box-shadow: 1px 0px 0px 0px rgba(169, 225, 123, 0.43);
}
.sel-system {
cursor: pointer;
display: flex;
align-items: center;
.icon {
height: 24px;
width: 24px;
background: url("../../../assets/images/bozhou/selSystem.png");
background-size: 100% 100%;
margin-right: 3px;
}
}
}
}
.sel-sysyem-text {
font-size: 16px;
font-family: "Alibaba-PuHuiTi-Regular";
font-weight: 400;
color: #f6fef8;
}
::v-deep .el-dropdown {}
::v-deep .el-dropdown-menu__item:not(.is-disabled):hover {
color: #51af5c;
}
.hamburger-container {
line-height: 30px;
height: 34px;
}
</style>

@ -6,217 +6,221 @@
* @FilePath: \bozhou-attendance-pc\src\views\home.vue
-->
<template>
<div class="container">
<div class="logo">
<div class="logo-icon"></div>
<div class="logo-title"></div>
</div>
<div class="grid-view">
<div
v-for="(item, index) in gridList"
:key="index"
@click="goSystem(item)"
>
<!-- :class="item.disable ? '' : 'goSysyem'" -->
<div class="title">{{ item.name }}</div>
<div class="vivew-logo">
<img :src="item.logo" alt="" />
</div>
<div class="btn">
<div>
{{ item.disable ? "系统开发中" : "进入系统" }}
</div>
</div>
</div>
</div>
<!-- <div class="footnote">苏ICP备20012657号 xxxx有限公司 版权所有</div> -->
</div>
<div class="container">
<div class="logo">
<div class="logo-icon"></div>
<div class="logo-title"></div>
</div>
<div class="grid-view">
<div v-for="(item, index) in gridList" :key="index" @click="goSystem(item)">
<!-- :class="item.disable ? '' : 'goSysyem'" -->
<div class="title">{{ item.name }}</div>
<div class="vivew-logo">
<img :src="item.logo" alt="" />
</div>
<div class="btn">
<div>
{{ item.disable ? "系统开发中" : "进入系统" }}
</div>
</div>
</div>
</div>
<!-- <div class="footnote">苏ICP备20012657号 xxxx有限公司 版权所有</div> -->
</div>
</template>
<script>
export default {
data() {
return {
gridList: [
{
name: "项目管理",
logo: require("../assets/images/bozhou/grid5-min.png"),
disable: false,
path: "/xitongHome",
},
{
name: "智慧生产管理",
logo: require("../assets/images/bozhou/grid1-min.png"),
disable: true,
path: "",
},
{
name: "智慧节水灌溉",
logo: require("../assets/images/bozhou/grid2-min.png"),
disable: true,
path: "",
},
{
name: "农田保护与利用",
logo: require("../assets/images/bozhou/grid3-min.png"),
disable: true,
path: "",
},
{
name: "农业科技服务",
logo: require("../assets/images/bozhou/grid4-min.png"),
disable: true,
path: "",
},
],
};
},
methods: {
goSystem(item) {
if (item.disable) {
this.$message({
message: "系统开发中 ",
type: "warning",
});
return;
}
if (item.name == "项目管理") {
this.$router.push({ path: item.path }).catch(() => {});
}
},
},
};
export default {
data() {
return {
gridList: [{
name: "项目管理",
logo: require("../assets/images/bozhou/grid5-min.png"),
disable: false,
path: "/xitongHome",
},
{
name: "智慧生产管理",
logo: require("../assets/images/bozhou/grid1-min.png"),
disable: true,
path: "",
},
{
name: "智慧节水灌溉",
logo: require("../assets/images/bozhou/grid2-min.png"),
disable: true,
path: "",
},
{
name: "农田保护与利用",
logo: require("../assets/images/bozhou/grid3-min.png"),
disable: true,
path: "",
},
{
name: "农业科技服务",
logo: require("../assets/images/bozhou/grid4-min.png"),
disable: true,
path: "",
},
],
};
},
methods: {
goSystem(item) {
if (item.disable) {
this.$message({
message: "系统开发中 ",
type: "warning",
});
return;
}
if (item.name == "项目管理") {
this.$router.push({
path: item.path
}).catch(() => {});
}
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/utils.scss";
.container {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
background: url(../assets/images/bozhou/img_bg.jpg) center center;
background-size: cover;
.logo {
position: absolute;
left: 50%;
top: vh(120);
transform: translateX(-50%);
display: flex;
align-items: center;
.logo-icon {
height: vw(80);
width: vw(85);
background: url("../assets/images/bozhou/logo@2x.png");
background-size: 100% 100%;
}
.logo-title {
margin-top: vh(10);
width: vw(1100);
height: vw(80);
background: url("../assets/images/bozhou/sysTitle.png") center bottom;
background-size: 100% 100%;
margin-left: vw(20);
}
}
.grid-view {
position: absolute;
bottom: vh(200);
left: 50%;
transform: translateX(-50%);
width: 95%;
height: vh(520);
display: flex;
align-items: center;
justify-content: space-between;
& > div {
width: vw(325);
height: 100%;
border-radius: vw(15);
background-image: linear-gradient(rgba(103, 207, 161, 0.7), transparent);
border-bottom: 0;
opacity: 0.7;
.title {
height: 25%;
// border: 1px solid;
font-size: vw(35);
letter-spacing: vw(3);
font-family: "PangMenZhengDao";
font-weight: bold;
color: #ffffff;
-webkit-text-stroke: 0.5px #007a5f;
text-stroke: 0.5px #007a5f;
display: flex;
justify-content: center;
align-items: center;
margin: 0 !important;
}
.vivew-logo {
width: 100%;
height: 50%;
padding: 0 vw(45);
// border: 1px solid;
img {
height: 100%;
width: 100%;
display: flex;
}
}
.btn {
width: 100%;
height: 25%;
display: flex;
align-items: center;
justify-content: center;
& > div {
background: url("../assets/images/bozhou/btn@2x.png");
background-size: 100% 100%;
padding: vh(28) vw(40);
font-size: vw(18);
font-family: "Alibaba-PuHuiTi-Regular";
font-weight: 400;
letter-spacing: vw(2);
color: #ffffff;
}
}
}
& > div:hover {
cursor: pointer;
background-image: linear-gradient(
rgba(207, 248, 155, 1),
transparent
) !important;
opacity: 1 !important;
}
}
.goSysyem {
background-image: linear-gradient(
rgba(207, 248, 155, 0.7),
transparent
) !important;
opacity: 1 !important;
}
.footnote {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: vh(38);
line-height: vh(40);
background: #000000;
text-align: center;
font-weight: 400;
color: #ffffff;
font-size: vw(15);
letter-spacing: vw(2);
font-family: "Alibaba-PuHuiTi-Regular";
}
}
.fade-leave-to {
display: none;
}
@import "@/assets/styles/utils.scss";
.container {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
background: url(../assets/images/bozhou/img_bg.jpg) center center;
background-size: cover;
.logo {
position: absolute;
left: 50%;
top: vh(120);
transform: translateX(-50%);
display: flex;
align-items: center;
.logo-icon {
height: vw(80);
width: vw(85);
background: url("../assets/images/bozhou/logo@2x.png");
background-size: 100% 100%;
}
.logo-title {
margin-top: vh(10);
width: vw(1100);
height: vw(80);
background: url("../assets/images/bozhou/new_logo_title.png") center bottom;
background-size: 100% 100%;
margin-left: vw(20);
}
}
.grid-view {
position: absolute;
bottom: vh(200);
left: 50%;
transform: translateX(-50%);
width: 95%;
height: vh(520);
display: flex;
align-items: center;
justify-content: space-between;
&>div {
width: vw(325);
height: 100%;
border-radius: vw(15);
background-image: linear-gradient(rgba(103, 207, 161, 0.7), transparent);
border-bottom: 0;
opacity: 0.7;
.title {
height: 25%;
// border: 1px solid;
font-size: vw(35);
letter-spacing: vw(3);
font-family: "PangMenZhengDao";
font-weight: bold;
color: #ffffff;
-webkit-text-stroke: 0.5px #007a5f;
text-stroke: 0.5px #007a5f;
display: flex;
justify-content: center;
align-items: center;
margin: 0 !important;
}
.vivew-logo {
width: 100%;
height: 50%;
padding: 0 vw(45);
// border: 1px solid;
img {
height: 100%;
width: 100%;
display: flex;
}
}
.btn {
width: 100%;
height: 25%;
display: flex;
align-items: center;
justify-content: center;
&>div {
background: url("../assets/images/bozhou/btn@2x.png");
background-size: 100% 100%;
padding: vh(28) vw(40);
font-size: vw(18);
font-family: "Alibaba-PuHuiTi-Regular";
font-weight: 400;
letter-spacing: vw(2);
color: #ffffff;
}
}
}
&>div:hover {
cursor: pointer;
background-image: linear-gradient(rgba(207, 248, 155, 1),
transparent) !important;
opacity: 1 !important;
}
}
.goSysyem {
background-image: linear-gradient(rgba(207, 248, 155, 0.7),
transparent) !important;
opacity: 1 !important;
}
.footnote {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: vh(38);
line-height: vh(40);
background: #000000;
text-align: center;
font-weight: 400;
color: #ffffff;
font-size: vw(15);
letter-spacing: vw(2);
font-family: "Alibaba-PuHuiTi-Regular";
}
}
.fade-leave-to {
display: none;
}
</style>

@ -11,7 +11,7 @@
:rules="loginRules"
class="login-form"
>
<h3 class="title">亳州高标准农田管理系统</h3>
<h3 class="title">高标准农田建设管理系统</h3>
<el-form-item prop="username">
<el-input
v-model.trim="loginForm.username"

@ -1,246 +1,242 @@
<template>
<div class="login">
<div class="logo-container">
<div class="logo-icon"></div>
<div class="logo-title"></div>
</div>
<el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login-form"
>
<div class="from-container">
<div class="logo-title">用户登录</div>
<el-form-item prop="username">
<el-input
v-model.trim="loginForm.username"
type="text"
auto-complete="off"
placeholder="用户名"
>
<div slot="prefix" class="input-icon">
<img src="../assets/images/bozhou/user.png" alt="" />
</div>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model.trim="loginForm.password"
type="password"
auto-complete="new-password"
placeholder="密码"
@keyup.enter.native="handleLogin"
>
<div slot="prefix" class="input-icon">
<img src="../assets/images/bozhou/passicon.png" alt="" />
</div>
</el-input>
</el-form-item>
<el-form-item prop="code">
<div class="code-input">
<el-input
v-model.trim="loginForm.code"
auto-complete="off"
placeholder="验证码"
style="width: 63%"
@keyup.enter.native="handleLogin"
>
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img" />
</div>
</div>
</el-form-item>
<el-checkbox v-model.trim="loginForm.rememberMe">记住密码</el-checkbox>
<el-form-item style="width: 100%">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width: 100%"
@click.native.prevent="handleLogin"
>
<span v-if="!loading"> </span>
<span v-else> ...</span>
</el-button>
</el-form-item>
</div>
</el-form>
<!-- 底部 -->
<!-- <div class="el-login-footer">
<div class="login">
<div class="logo-container">
<div class="logo-icon"></div>
<div class="logo-title"></div>
</div>
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<div class="from-container">
<div class="logo-title">用户登录</div>
<el-form-item prop="username">
<el-input v-model.trim="loginForm.username" type="text" auto-complete="off" placeholder="用户名">
<div slot="prefix" class="input-icon">
<img src="../assets/images/bozhou/user.png" alt="" />
</div>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model.trim="loginForm.password" type="password" auto-complete="new-password"
placeholder="密码" @keyup.enter.native="handleLogin">
<div slot="prefix" class="input-icon">
<img src="../assets/images/bozhou/passicon.png" alt="" />
</div>
</el-input>
</el-form-item>
<el-form-item prop="code">
<div class="code-input">
<el-input v-model.trim="loginForm.code" auto-complete="off" placeholder="验证码" style="width: 63%"
@keyup.enter.native="handleLogin">
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img" />
</div>
</div>
</el-form-item>
<el-checkbox v-model.trim="loginForm.rememberMe">记住密码</el-checkbox>
<el-form-item style="width: 100%">
<el-button :loading="loading" size="medium" type="primary" style="width: 100%"
@click.native.prevent="handleLogin">
<span v-if="!loading"> </span>
<span v-else> ...</span>
</el-button>
</el-form-item>
</div>
</el-form>
<!-- 底部 -->
<!-- <div class="el-login-footer">
<span>Copyright © 2019-2021 zjg All Rights Reserved.</span>
</div> -->
</div>
</div>
</template>
<script>
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from "@/utils/jsencrypt";
export default {
name: "Login",
data() {
return {
codeUrl: "",
cookiePassword: "",
loginForm: {
// username: "admin",
// password: "admin123",
username: "",
password: "",
rememberMe: false,
code: "",
uuid: "",
},
loginRules: {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" },
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" },
],
// code: [{ required: true, trigger: "change", message: "" }],
},
loading: false,
//
captchaOnOff: false,
//
register: false,
redirect: undefined,
};
},
watch: {
$route: {
handler: function (route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true,
},
},
created() {
this.getCode();
this.getCookie();
},
methods: {
getCode() {
getCodeImg().then((res) => {
this.captchaOnOff =
res.captchaOnOff === undefined ? true : res.captchaOnOff;
if (this.captchaOnOff) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
}
});
},
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
const rememberMe = Cookies.get("rememberMe");
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password:
password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
},
handleLogin() {
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), {
expires: 30,
});
Cookies.set("rememberMe", this.loginForm.rememberMe, {
expires: 30,
});
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove("rememberMe");
}
this.$store
.dispatch("Login", this.loginForm)
.then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => {});
})
.catch(() => {
this.loading = false;
if (this.captchaOnOff) {
this.getCode();
}
});
}
});
},
},
};
import {
getCodeImg
} from "@/api/login";
import Cookies from "js-cookie";
import {
encrypt,
decrypt
} from "@/utils/jsencrypt";
export default {
name: "Login",
data() {
return {
codeUrl: "",
cookiePassword: "",
loginForm: {
// username: "admin",
// password: "admin123",
username: "",
password: "",
rememberMe: false,
code: "",
uuid: "",
},
loginRules: {
username: [{
required: true,
trigger: "blur",
message: "请输入您的账号"
}, ],
password: [{
required: true,
trigger: "blur",
message: "请输入您的密码"
}, ],
// code: [{ required: true, trigger: "change", message: "" }],
},
loading: false,
//
captchaOnOff: false,
//
register: false,
redirect: undefined,
};
},
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true,
},
},
created() {
this.getCode();
this.getCookie();
},
methods: {
getCode() {
getCodeImg().then((res) => {
this.captchaOnOff =
res.captchaOnOff === undefined ? true : res.captchaOnOff;
if (this.captchaOnOff) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
}
});
},
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
const rememberMe = Cookies.get("rememberMe");
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
},
handleLogin() {
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, {
expires: 30
});
Cookies.set("password", encrypt(this.loginForm.password), {
expires: 30,
});
Cookies.set("rememberMe", this.loginForm.rememberMe, {
expires: 30,
});
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove("rememberMe");
}
this.$store
.dispatch("Login", this.loginForm)
.then(() => {
this.$router.push({
path: this.redirect || "/"
}).catch(() => {});
})
.catch(() => {
this.loading = false;
if (this.captchaOnOff) {
this.getCode();
}
});
}
});
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
@import "@/assets/styles/utils.scss";
.login {
height: 100%;
background: url("../assets/images/bozhou/bg-min.jpg") center center;
background-size: cover;
position: relative;
}
// .title {
// margin: 0px auto 30px auto;
// text-align: center;
// color: #707070;
// }
.login-form {
border-radius: 6px;
background: #ffffff;
width: 400px;
padding: 25px 25px 5px 25px;
.el-input {
height: 38px;
input {
height: 38px;
}
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 2px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.login-code {
width: 33%;
height: 38px;
float: right;
img {
cursor: pointer;
vertical-align: middle;
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 38px;
}
@import "@/assets/styles/utils.scss";
.login {
height: 100%;
background: url("../assets/images/bozhou/bg-min.jpg") center center;
background-size: cover;
position: relative;
}
// .title {
// margin: 0px auto 30px auto;
// text-align: center;
// color: #707070;
// }
.login-form {
border-radius: 6px;
background: #ffffff;
width: 400px;
padding: 25px 25px 5px 25px;
.el-input {
height: 38px;
input {
height: 38px;
}
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 2px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.login-code {
width: 33%;
height: 38px;
float: right;
img {
cursor: pointer;
vertical-align: middle;
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 38px;
}
</style>

@ -6,7 +6,7 @@ function resolve(dir) {
return path.join(__dirname, dir);
}
const name = process.env.VUE_APP_TITLE || "亳州高标准农田管理系统"; // 网页标题
const name = process.env.VUE_APP_TITLE || "高标准农田建设管理系统"; // 网页标题
const port = process.env.port || process.env.npm_config_port || 80; // 端口

Loading…
Cancel
Save