app接收到报警记录后处理方法

This commit is contained in:
xusd 2024-06-03 09:30:34 +08:00
parent 05664feb52
commit 52f83b39e0

78
App.vue
View File

@ -1,35 +1,53 @@
<script> <script>
import config from './config' import config from './config'
import store from '@/store' import store from '@/store'
import { getToken } from '@/utils/auth' import {
getToken
} from '@/utils/auth'
export default { export default {
onLaunch: function() { onLaunch: function() {
this.initApp() this.initApp();
}, this.listenMessage();
methods: { },
// methods: {
initApp() { listenMessage() {
// // #ifdef APP-PLUS
this.initConfig() const _self = this;
// const _handlePush = function(message) {
//#ifdef H5 // TODO
this.checkLogin() console.log(message);
//#endif if (message.payload.type === "alarm") {
}, uni.navigateTo({
initConfig() { url: '/pages/work/alarm/detailsAlarm?id=' + message.payload.id
this.globalData.config = config });
}, }
checkLogin() { };
if (!getToken()) { plus.push.addEventListener('click', _handlePush);
this.$tab.reLaunch('/pages/login') // #endif
} },
} //
} initApp() {
} //
this.initConfig()
//
//#ifdef H5
this.checkLogin()
//#endif
},
initConfig() {
this.globalData.config = config
},
checkLogin() {
if (!getToken()) {
this.$tab.reLaunch('/pages/login')
}
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/static/scss/index.scss'; @import '@/static/scss/index.scss';
@import "uview-ui/index.scss"; @import "uview-ui/index.scss";
</style> </style>