Commit a54e2b21 authored by wxk's avatar wxk

检测登录

parent c4ad0ff5
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
this.$router.push({ this.$router.push({
path: '/' path: '/'
}); });
localStorage["isLogin"] = false;
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: "退出成功", message: "退出成功",
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<span @click="goShowPanel(3)" class="bluepoint">找回密码</span> <span @click="goShowPanel(3)" class="bluepoint">找回密码</span>
</span> </span>
<input type="checkbox" name="记住用户密码" class="rember" v-model="isSaveLoginInfo"> <input type="checkbox" name="记住用户密码" class="rember" v-model="isSaveLoginInfo">
<span>记住用户名</span> <span>记住密码</span>
</div> </div>
<el-button type="primary" class="loginget" @click="Login">立刻登录</el-button> <el-button type="primary" class="loginget" @click="Login">立刻登录</el-button>
</div> </div>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<input type="text" placeholder="请输入验证码" class="usercomyzm" v-model="regist_yzm"> <input type="text" placeholder="请输入验证码" class="usercomyzm" v-model="regist_yzm">
<el-button type="primary" class="getyzm" @click="getYZM('regist')" :disabled='!show'> <el-button type="primary" class="getyzm" @click="getYZM('regist')" :disabled='!show'>
<span v-show = "show">获取验证码</span> <span v-show = "show">获取验证码</span>
<span v-show = "!show" class="count">还剩下{{count}} s</span> <span v-show = "!show" class="count">已发送{{count}} s</span>
</el-button> </el-button>
</div> </div>
<div class="ground" style="margin-bottom:70px;"> <div class="ground" style="margin-bottom:70px;">
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<input type="text" placeholder="请输入验证码" class="usercomyzm" v-model="forget_yzm"> <input type="text" placeholder="请输入验证码" class="usercomyzm" v-model="forget_yzm">
<el-button type="primary" class="getyzm" @click="getYZM('forgetpassword')" :disabled='!show'> <el-button type="primary" class="getyzm" @click="getYZM('forgetpassword')" :disabled='!show'>
<span v-show = "show">获取验证码</span> <span v-show = "show">获取验证码</span>
<span v-show = "!show" class="count">还剩下{{count}} s</span> <span v-show = "!show" class="count">已发送{{count}} s</span>
</el-button> </el-button>
</div> </div>
<div class="groupcom inputpwd"> <div class="groupcom inputpwd">
...@@ -319,8 +319,9 @@ export default { ...@@ -319,8 +319,9 @@ export default {
path:'/monitor' path:'/monitor'
}) })
this.doAfterlogin(res) this.doAfterlogin(res);
localStorage["username"] = this.loginBody.email; localStorage["username"] = this.loginBody.email;
localStorage["isLogin"] = true;
}else{ }else{
this.$notify({ this.$notify({
title: '提示', title: '提示',
......
...@@ -48,6 +48,11 @@ ...@@ -48,6 +48,11 @@
}, },
created() { created() {
this.getPlatInfo(); this.getPlatInfo();
if (localStorage.getItem("isLogin")==='false') {
this.$router.push({
path: '/'
});
}
}, },
methods: { methods: {
getPlatInfo() { getPlatInfo() {
......
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