xinelu-applet-ui/App.vue
2024-03-19 11:19:46 +08:00

44 lines
822 B
Vue

<script>
import {
mapMutations
} from "vuex";
import {
createMobileToken
} from '@/api/pages/login/index.js'
export default {
onLaunch: function() {},
methods: {
...mapMutations(['socketOpenfalse']),
...mapMutations(['scoket']),
},
onShow: function() {
if (uni.getStorageSync('patientId') && !this.$store.state.socketOpen) {
this.scoket();
}
createMobileToken().then(res => {
uni.setStorageSync("token", res.data.token)
})
},
onHide: function() {
this.socketOpenfalse();
uni.closeSocket();
clearInterval(this.$store.state.timeoutObj);
}
}
</script>
<style lang="scss">
@import "uview-ui/index.scss";
/*每个页面公共css */
page {
background-color: #F4F5F7;
}
.app {
width: 100%;
height: 100%;
text-align: justify;
color: #000000;
}
</style>