桌面添加token过期的跳转到登陆页的处理.应用通过postMessage通知桌面
| | |
| | | height: this.data.height || 512 |
| | | } |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('message', e => { |
| | | if (e.data && e.data.msg == "logout") { |
| | | location.assign("/"); |
| | | } |
| | | }) |
| | | }, |
| | | methods: { |
| | | closeFrame: function () { |
| | | this.$store.dispatch('desktop/closeFrame', this.data); |
| | |
| | | res => { |
| | | /* //对响应数据做些事 */ |
| | | if (res.data && res.statusText !== 'OK' && res.status !== 200) { |
| | | console.log('听说你对相应数据做了些事', res) |
| | | Notification({ |
| | | title: '', |
| | | message: res.data.message, |
| | |
| | | // } else { |
| | | // window.sessionStorage.setItem('policeCameravideoIsLoginTimeout', JSON.stringify(true)) |
| | | // } |
| | | |
| | | return res.data ? res.data : {} |
| | | |
| | | /* //return res.data ? res.data : {}; */ |
| | |
| | | case 401: |
| | | errJson.status = error.response.status |
| | | errJson.message = '未授权,请重新登录(401)' |
| | | window.parent.postMessage({ |
| | | msg: "logout" |
| | | }, '*') |
| | | // console.log("标志位:",AuthData.isLoginout) |
| | | // if (!AuthData.isLoginout) { |
| | | // Notification({ |