登录功能完成
This commit is contained in:
parent
23fad30ea6
commit
aa285cf04e
|
|
@ -240,7 +240,10 @@ export default {
|
||||||
// 退出登录
|
// 退出登录
|
||||||
onLogout() {
|
onLogout() {
|
||||||
loginOut().then(res => {
|
loginOut().then(res => {
|
||||||
location.href = '/login#/container/login'
|
location.href = '/#/container/login'
|
||||||
|
setTimeout(() => {
|
||||||
|
location.reload()
|
||||||
|
}, 100)
|
||||||
localStorage.setItem('isLogin', false)
|
localStorage.setItem('isLogin', false)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const isLogin = localStorage.getItem('isLogin')
|
const isLogin = localStorage.getItem('isLogin')
|
||||||
if (isLogin == 'false') {
|
if (isLogin == 'false' || isLogin == '' || isLogin == undefined) {
|
||||||
this.$router.push({ name: 'home' })
|
this.$router.push({ name: 'home' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const isLogin = localStorage.getItem('isLogin')
|
const isLogin = localStorage.getItem('isLogin')
|
||||||
if (isLogin == 'false') {
|
if (isLogin == 'false' || isLogin == '' || isLogin == undefined) {
|
||||||
this.$router.push({ name: 'home' })
|
this.$router.push({ name: 'home' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const isLogin = localStorage.getItem('isLogin')
|
const isLogin = localStorage.getItem('isLogin')
|
||||||
if (isLogin == 'false') {
|
if (isLogin == 'false' || isLogin == '' || isLogin == undefined) {
|
||||||
this.$router.push({ name: 'home' })
|
this.$router.push({ name: 'home' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const isLogin = localStorage.getItem('isLogin')
|
const isLogin = localStorage.getItem('isLogin')
|
||||||
if (isLogin == 'false') {
|
if (isLogin == 'false' || isLogin == '' || isLogin == undefined) {
|
||||||
this.$router.push({ name: 'home' })
|
this.$router.push({ name: 'home' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const isLogin = localStorage.getItem('isLogin')
|
const isLogin = localStorage.getItem('isLogin')
|
||||||
if (isLogin == 'false') {
|
if (isLogin == 'false' || isLogin == '' || isLogin == undefined) {
|
||||||
this.$router.push({ name: 'home' })
|
this.$router.push({ name: 'home' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const isLogin = localStorage.getItem('isLogin')
|
const isLogin = localStorage.getItem('isLogin')
|
||||||
if (isLogin == 'false') {
|
if (isLogin == 'false' || isLogin == '' || isLogin == undefined) {
|
||||||
this.$router.push({ name: 'home' })
|
this.$router.push({ name: 'home' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const isLogin = localStorage.getItem('isLogin')
|
const isLogin = localStorage.getItem('isLogin')
|
||||||
if (isLogin == 'false') {
|
if (isLogin == 'false' || isLogin == '' || isLogin == undefined) {
|
||||||
this.$router.push({ name: 'home' })
|
this.$router.push({ name: 'home' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const isLogin = localStorage.getItem('isLogin')
|
const isLogin = localStorage.getItem('isLogin')
|
||||||
if (isLogin == 'false') {
|
if (isLogin == 'false' || isLogin == '' || isLogin == undefined) {
|
||||||
this.$router.push({ name: 'home' })
|
this.$router.push({ name: 'home' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const isLogin = localStorage.getItem('isLogin')
|
const isLogin = localStorage.getItem('isLogin')
|
||||||
if (isLogin == 'false') {
|
if (isLogin == 'false' || isLogin == '' || isLogin == undefined) {
|
||||||
this.$router.push({ name: 'home' })
|
this.$router.push({ name: 'home' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const isLogin = localStorage.getItem('isLogin')
|
const isLogin = localStorage.getItem('isLogin')
|
||||||
if (isLogin == 'false') {
|
if (isLogin == 'false' || isLogin == '' || isLogin == undefined) {
|
||||||
this.$router.push({ name: 'home' })
|
this.$router.push({ name: 'home' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue