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

删除菜单

parent 8d56510b
<template>
<div class="login">
<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>
<div class="login-form-content">
<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" />
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-form-item v-if="needPassWord" prop="password">
<el-input
v-model="loginForm.password"
type="password"
......@@ -20,27 +20,27 @@
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<!-- <el-form-item prop="code">-->
<!-- <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>-->
<!-- &lt;!&ndash;<div class="login-code">-->
<!-- <img :src="codeUrl" @click="getCode">-->
<!-- </div>&ndash;&gt;-->
<!-- </el-form-item>-->
<!-- <el-form-item prop="code">-->
<!-- <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>-->
<!-- &lt;!&ndash;<div class="login-code">-->
<!-- <img :src="codeUrl" @click="getCode">-->
<!-- </div>&ndash;&gt;-->
<!-- </el-form-item>-->
<el-form-item style="width:80%;margin-bottom: 20px">
<el-button
class="blue-btn"
:loading="loading"
size="medium"
type="primary"
@click.native.prevent="handleLogin"
@click.native.prevent="needPassword"
>
<span v-if="!loading">登 录</span>
<span v-else>登 录 中...</span>
......@@ -50,12 +50,12 @@
class="buttons-content"
>
<el-checkbox v-model="loginForm.rememberMe" class="rem-code">记住密码</el-checkbox>
<!-- <el-link-->
<!-- :underline="false"-->
<!-- @click="goDetail('/forgetPwd')"-->
<!-- >-->
<!-- <router-link to="/forgetPwd">忘记密码</router-link>-->
<!-- </el-link>-->
<!-- <el-link-->
<!-- :underline="false"-->
<!-- @click="goDetail('/forgetPwd')"-->
<!-- >-->
<!-- <router-link to="/forgetPwd">忘记密码</router-link>-->
<!-- </el-link>-->
</div>
</div>
</el-form>
......@@ -73,6 +73,7 @@ export default {
name: 'Login',
data() {
return {
needPassWord: false,
exist: false,
reLocation: '',
codeUrl: '',
......@@ -96,11 +97,62 @@ export default {
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() {
// this.getCode()
this.getCookie()
},
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) {
this.$router.push({
path: path,
......@@ -141,8 +193,8 @@ export default {
.then(() => {
// window.location.href = `${this.reLocation}/#/`
// this.$router.push({ path: `http://main.court.com${this.redirect || "/"}` });
this.loading = false
this.$router.push('/controlPlatform/control')
// this.loading = false
// this.$router.push('/home')
})
.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