登录功能完成

This commit is contained in:
2024-08-12 10:01:43 +08:00
parent d433cc75f6
commit 23fad30ea6
11 changed files with 52 additions and 1 deletions

View File

@ -241,6 +241,7 @@ export default {
onLogout() {
loginOut().then(res => {
location.href = '/login#/container/login'
localStorage.setItem('isLogin', false)
})
},
//
@ -248,6 +249,7 @@ export default {
initInfo().then(res => {
Cookies.set('JSESSIONID', res.map.FrameSessionId);
this.isLogin = res.login
localStorage.setItem('isLogin', res.login)
if (this.isLogin) {
this.menuList = this.adminMenu
} else {

View File

@ -91,7 +91,11 @@ export default {
}
},
created() {
const isLogin = localStorage.getItem('isLogin')
if (isLogin == 'false') {
this.$router.push({ name: 'home' })
return
}
},
methods: {
handleBtn(item) {

View File

@ -247,6 +247,11 @@ export default {
}
},
created() {
const isLogin = localStorage.getItem('isLogin')
if (isLogin == 'false') {
this.$router.push({ name: 'home' })
return
}
this.getData()
},
methods: {

View File

@ -119,6 +119,11 @@ export default {
}
},
created() {
const isLogin = localStorage.getItem('isLogin')
if (isLogin == 'false') {
this.$router.push({ name: 'home' })
return
}
this.getData()
},
methods: {

View File

@ -119,6 +119,11 @@ export default {
}
},
created() {
const isLogin = localStorage.getItem('isLogin')
if (isLogin == 'false') {
this.$router.push({ name: 'home' })
return
}
this.getData()
},
methods: {

View File

@ -119,6 +119,11 @@ export default {
}
},
created() {
const isLogin = localStorage.getItem('isLogin')
if (isLogin == 'false') {
this.$router.push({ name: 'home' })
return
}
this.getData()
},
methods: {

View File

@ -142,6 +142,11 @@ export default {
}
},
created() {
const isLogin = localStorage.getItem('isLogin')
if (isLogin == 'false') {
this.$router.push({ name: 'home' })
return
}
this.getData()
},
methods: {

View File

@ -109,6 +109,11 @@ export default {
}
},
created() {
const isLogin = localStorage.getItem('isLogin')
if (isLogin == 'false') {
this.$router.push({ name: 'home' })
return
}
this.getData()
},
methods: {

View File

@ -218,6 +218,11 @@ export default {
}
},
created() {
const isLogin = localStorage.getItem('isLogin')
if (isLogin == 'false') {
this.$router.push({ name: 'home' })
return
}
// this.init()
},
methods: {

View File

@ -136,6 +136,11 @@ export default {
}
},
created() {
const isLogin = localStorage.getItem('isLogin')
if (isLogin == 'false') {
this.$router.push({ name: 'home' })
return
}
// this.init()
},
methods: {

View File

@ -246,6 +246,11 @@ export default {
}
},
created() {
const isLogin = localStorage.getItem('isLogin')
if (isLogin == 'false') {
this.$router.push({ name: 'home' })
return
}
// this.init()
const arr = [
{