|
@@ -1,52 +1,53 @@
|
|
<template>
|
|
<template>
|
|
- <div class="login">
|
|
|
|
- <StarBackground />
|
|
|
|
- <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
|
|
|
- <h3 class="title"> 通榆县乡村振兴综合监管平台</h3>
|
|
|
|
- <h3 class="title">数字环保</h3>
|
|
|
|
- <div class="login-container">
|
|
|
|
- <h4>请登录</h4>
|
|
|
|
- <el-form-item prop="username">
|
|
|
|
- <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号"
|
|
|
|
- class="m-b-15">
|
|
|
|
- <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item prop="password">
|
|
|
|
- <el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码"
|
|
|
|
- @keyup.enter.native="handleLogin" class="m-b-15">
|
|
|
|
- <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item prop="code" v-if="captchaOnOff">
|
|
|
|
- <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-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</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>
|
|
|
|
- <div style="float: right;" v-if="register">
|
|
|
|
- <router-link class="link-type" :to="'/register'">立即注册</router-link>
|
|
|
|
- </div>
|
|
|
|
- </el-form-item>
|
|
|
|
- </div>
|
|
|
|
- </el-form>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="login" :style="{backgroundImage: 'url('+backgroudImg+')'}">
|
|
|
|
+ <StarBackground />
|
|
|
|
+ <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
|
|
|
+ <h3 class="sub-title" v-if="systemTitle.subTitle">{{systemTitle.subTitle}}</h3>
|
|
|
|
+ <h3 class="title">{{systemTitle.title}}</h3>
|
|
|
|
+
|
|
|
|
+ <div class="login-container">
|
|
|
|
+ <h4>请登录</h4>
|
|
|
|
+ <el-form-item prop="username">
|
|
|
|
+ <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号"
|
|
|
|
+ class="m-b-15">
|
|
|
|
+ <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
|
|
|
+ </el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item prop="password">
|
|
|
|
+ <el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码"
|
|
|
|
+ @keyup.enter.native="handleLogin" class="m-b-15">
|
|
|
|
+ <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
|
|
|
+ </el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item prop="code" v-if="captchaOnOff">
|
|
|
|
+ <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-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</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>
|
|
|
|
+ <div style="float: right;" v-if="register">
|
|
|
|
+ <router-link class="link-type" :to="'/register'">立即注册</router-link>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import StarBackground from '@/components/star'
|
|
import StarBackground from '@/components/star'
|
|
import {
|
|
import {
|
|
- getCodeImg
|
|
|
|
|
|
+ getCodeImg,fontConfig
|
|
} from '@/api/login'
|
|
} from '@/api/login'
|
|
import Cookies from 'js-cookie'
|
|
import Cookies from 'js-cookie'
|
|
import {
|
|
import {
|
|
@@ -64,6 +65,11 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ backgroudImg:require('../../assets/images/login/login-ty.jpg'), //背景图片
|
|
|
|
+ systemTitle:{
|
|
|
|
+ title:'通榆县乡村振兴综合监管平台', //标题
|
|
|
|
+ subTitle:'数字环保' ,//副标题
|
|
|
|
+ },
|
|
codeUrl: '',
|
|
codeUrl: '',
|
|
loginForm: {
|
|
loginForm: {
|
|
username: 'admin',
|
|
username: 'admin',
|
|
@@ -108,8 +114,16 @@
|
|
created() {
|
|
created() {
|
|
this.getCode()
|
|
this.getCode()
|
|
this.getCookie()
|
|
this.getCookie()
|
|
|
|
+ this.fontConfig();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ fontConfig(){
|
|
|
|
+ fontConfig().then(res => {
|
|
|
|
+ this.systemTitle.title = res.data.fontTitle;
|
|
|
|
+ this.systemTitle.subTitle = res.data.subTitle;
|
|
|
|
+ this.backgroudImg = res.data.picUrl;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getCode() {
|
|
getCode() {
|
|
getCodeImg().then(res => {
|
|
getCodeImg().then(res => {
|
|
this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff
|
|
this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff
|