zhuguifei
2025-07-04 186d172fc06dfe44dc2a61d238356e6a7db652d5
App.vue
@@ -2,11 +2,16 @@
   import Vue from 'vue'
   export default {
      //全局变量(同步数据可用全局变量,异步数据使用vuex)
      globalData: {
         token: ""
         token: "",
         //当前选择tab
         selectTab: 0,
         //当前网络模式(cloud-云服务、lan-局域网)
         mode: "",
      },
      onLaunch: function() {
         //此处为unipush2.0的推送方法
@@ -27,19 +32,17 @@
         //推送仅支持Android ios原生平台
         // #ifdef APP-PLUS
         console.log('APP-PLUS:')
         // 此处为unipush1.0的推送方法
         plus.push.getClientInfoAsync((info) => {
            let cid = info["clientid"];
            console.log('客户端推送标识:', cid)
            this.$store.dispatch('setCid', cid); // 使用 action 更新 cid
            this.$store.dispatch('setClientPushId', cid); // 使用 action 更新 cid
         });
         // #endif
         uni.onPushMessage((res) => {
            console.log("收到推送消息:", res) //监听推送消息
         })
         uni.getSystemInfo({
            success: function(e) {
@@ -96,12 +99,7 @@
            if (this.$mqttTool.client) {
               console.log(this.$mqttTool.client.connected)
            }
            // if(this.$mqttTool.client){
            //    this.$mqttTool.end().then(res =>{
            //       console.log('终止:')
            //    })
            // }
         }
      },