|
@@ -468,13 +468,34 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- let userInfo=localStorage.getItem('pro__Login_Userinfo')
|
|
|
- if (!userInfo) {
|
|
|
- this.$router.push({ path: '/user/login'})
|
|
|
- }
|
|
|
-
|
|
|
+ // let userInfo=localStorage.getItem('pro__Login_Userinfo')
|
|
|
+ // if (!userInfo) {
|
|
|
+ // this.$router.push({ path: '/user/login'})
|
|
|
+ // }
|
|
|
+ if(!this.userInfo()){
|
|
|
+ this.$router.push({ path: '/user/login'})
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
+ // updated(){
|
|
|
+
|
|
|
+
|
|
|
+ // },
|
|
|
+ beforeRouteLeave (to, from) {
|
|
|
+ if(!this.userInfo()){
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '当前登录已失效,请重新登陆',
|
|
|
+ onOk() {
|
|
|
+
|
|
|
+ window.location.href="/";
|
|
|
+
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
mounted() {
|
|
|
|