Commit 744c33ed authored by 高宇's avatar 高宇

删除菜单

parent 8d56510b
<template> <template>
<div class="login"> <div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<!-- <img class="fy-logo" src="../../assets/image/denglu_logo.png">--> <!-- <img class="fy-logo" src="../../assets/image/denglu_logo.png">-->
<h3 class="title">信息化管理系统</h3> <h3 class="title">信息化管理系统</h3>
<div class="login-form-content"> <div class="login-form-content">
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号"> <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号" @keyup.enter.native="needPassword">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item v-if="needPassWord" prop="password">
<el-input <el-input
v-model="loginForm.password" v-model="loginForm.password"
type="password" type="password"
...@@ -20,27 +20,27 @@ ...@@ -20,27 +20,27 @@
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input> </el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item prop="code">--> <!-- <el-form-item prop="code">-->
<!-- <el-input--> <!-- <el-input-->
<!-- v-model="loginForm.code"--> <!-- v-model="loginForm.code"-->
<!-- auto-complete="off"--> <!-- auto-complete="off"-->
<!-- placeholder="验证码"--> <!-- placeholder="验证码"-->
<!-- style="width: 63%"--> <!-- style="width: 63%"-->
<!-- @keyup.enter.native="handleLogin"--> <!-- @keyup.enter.native="handleLogin"-->
<!-- >--> <!-- >-->
<!-- <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />--> <!-- <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />-->
<!-- </el-input>--> <!-- </el-input>-->
<!-- &lt;!&ndash;<div class="login-code">--> <!-- &lt;!&ndash;<div class="login-code">-->
<!-- <img :src="codeUrl" @click="getCode">--> <!-- <img :src="codeUrl" @click="getCode">-->
<!-- </div>&ndash;&gt;--> <!-- </div>&ndash;&gt;-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item style="width:80%;margin-bottom: 20px"> <el-form-item style="width:80%;margin-bottom: 20px">
<el-button <el-button
class="blue-btn" class="blue-btn"
:loading="loading" :loading="loading"
size="medium" size="medium"
type="primary" type="primary"
@click.native.prevent="handleLogin" @click.native.prevent="needPassword"
> >
<span v-if="!loading">登 录</span> <span v-if="!loading">登 录</span>
<span v-else>登 录 中...</span> <span v-else>登 录 中...</span>
...@@ -50,12 +50,12 @@ ...@@ -50,12 +50,12 @@
class="buttons-content" class="buttons-content"
> >
<el-checkbox v-model="loginForm.rememberMe" class="rem-code">记住密码</el-checkbox> <el-checkbox v-model="loginForm.rememberMe" class="rem-code">记住密码</el-checkbox>
<!-- <el-link--> <!-- <el-link-->
<!-- :underline="false"--> <!-- :underline="false"-->
<!-- @click="goDetail('/forgetPwd')"--> <!-- @click="goDetail('/forgetPwd')"-->
<!-- >--> <!-- >-->
<!-- <router-link to="/forgetPwd">忘记密码</router-link>--> <!-- <router-link to="/forgetPwd">忘记密码</router-link>-->
<!-- </el-link>--> <!-- </el-link>-->
</div> </div>
</div> </div>
</el-form> </el-form>
...@@ -73,6 +73,7 @@ export default { ...@@ -73,6 +73,7 @@ export default {
name: 'Login', name: 'Login',
data() { data() {
return { return {
needPassWord: false,
exist: false, exist: false,
reLocation: '', reLocation: '',
codeUrl: '', codeUrl: '',
...@@ -96,11 +97,62 @@ export default { ...@@ -96,11 +97,62 @@ export default {
loading: false loading: false
} }
}, },
watch: {
'loginForm.username': {
handler(newValue, oldValue) {
if (newValue !== oldValue && newValue.length >= 2) {
const tempValue = newValue.slice(0, 2)
if (tempValue !== '00') {
this.needPassWord = true
} else {
this.needPassWord = false
}
}
}
}
},
created() { created() {
// this.getCode() // this.getCode()
this.getCookie() this.getCookie()
}, },
methods: { methods: {
// 判断该账户是否是特殊字符开头的
isSpecialAccount(value) {
let tempValue = ''
tempValue = value.slice(0, 2)
console.log('tempValue', tempValue)
if (tempValue === '00') {
return true
} else {
return false
}
// 截取value的前两位的字符
},
// 判断该账户是否需要密码
needPassword() {
console.log('这个方法判断是否需要密码')
if (this.loginForm.username.length < 2) {
this.needPassWord = true
if (this.loginForm.password !== '') {
console.log('登录')
this.handleLogin()
}
return
}
if (this.isSpecialAccount(this.loginForm.username)) {
// 这个账户不需要密码
this.needPassWord = false
this.loginForm.password = 'admin321'
this.handleLogin()
} else {
this.needPassWord = true
console.log('password', this.loginForm.password)
if (this.loginForm.password !== '') {
console.log('登录')
this.handleLogin()
}
}
},
goDetail(path) { goDetail(path) {
this.$router.push({ this.$router.push({
path: path, path: path,
...@@ -141,8 +193,8 @@ export default { ...@@ -141,8 +193,8 @@ export default {
.then(() => { .then(() => {
// window.location.href = `${this.reLocation}/#/` // window.location.href = `${this.reLocation}/#/`
// this.$router.push({ path: `http://main.court.com${this.redirect || "/"}` }); // this.$router.push({ path: `http://main.court.com${this.redirect || "/"}` });
this.loading = false
this.$router.push('/controlPlatform/control') this.$router.push('/controlPlatform/control')
// this.loading = false
// this.$router.push('/home') // this.$router.push('/home')
}) })
.catch(() => { .catch(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment