| | |
| | | <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) => { |
| | |
| | | } |
| | | }) |
| | | // }, |
| | | |
| | | console.log(uni.getStorageSync('access_token')); |
| | | var data = {} |
| | | data.token = uni.getStorageSync('access_token') |
| | | var method ='GET' |
| | |
| | | }, |
| | | 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); |
| | |
| | | // uni.$u.toast('网络不通'); |
| | | // reject(error) |
| | | }, |
| | | complete() { |
| | | uni.hideLoading(); |
| | | } |
| | | // complete() { |
| | | // uni.hideLoading(); |
| | | // } |
| | | }); |
| | | uni.getSystemInfo({ |
| | | success: function(e) { |