王飞
2025-03-07 c5e49c10499435802a6551b98772f95660c6f85a
App.vue
@@ -1,10 +1,14 @@
<script>
   import Vue from 'vue'
   import store from './store/index.js'
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
   import updateCustomBarInfo from './tuniao-ui/libs/function/updateCustomBarInfo.js'
   export default {
      onLaunch: function() { 
         setTimeout(() => {
                  // app 检测更新
                  checkUpdate();
               }, 2000);
                  console.log('App Launch')
                  uni.getPushClientId({
                     success: (res) => { 
@@ -27,7 +31,7 @@
                     }
                   })
               // },
         console.log(uni.getStorageSync('access_token'));
         var data = {}
         data.token =  uni.getStorageSync('access_token')
         var method ='GET'
@@ -45,19 +49,24 @@
            },
            timeout:5000,//设置超时时间,默认5秒
            success: (rep) => { //具体捕获请看自己接口返回的形式
            console.log(rep);
         if (rep.data.code!=0) {
            store.commit('$tStore', {
               name: 'vuex_is_login',
               value: false
            })
            // uni.reLaunch({
            //    url: '/pages/index/login'
            // });
            uni.reLaunch({
               url: '/pages/index/login'
               url: '/pages/index/index'
            });
         }else{
            uni.reLaunch({
               url: '/pages/index/index'
            });
         }
            },
            fail(error) {
               console.log(error);
@@ -65,9 +74,9 @@
               // uni.$u.toast('网络不通');
               // reject(error)
            },
            complete() {
               uni.hideLoading();
            }
            // complete() {
            //    uni.hideLoading();
            // }
         });
         uni.getSystemInfo({
            success: function(e) {