| | |
| | | }, |
| | | onLaunch: function() { |
| | | var that = this; |
| | | console.log(this.userInfo) |
| | | if (!this.userInfo || JSON.stringify(this.userInfo) == '{}') { |
| | | if (!this.openid || this.openid =='') { |
| | | uni.login({ |
| | | provider: 'weixin', |
| | | success: async function (loginRes) { |
| | |
| | | }, |
| | | onShow: function() { |
| | | console.log('App Show') |
| | | var that =this |
| | | let res = this.$u.api.getMemberInfo({}).then(res =>{ |
| | | if (res.code ===200) { |
| | | that.$store.commit('setUserInfo', res.data) |
| | | that.$isResolve() |
| | | }else{ |
| | | that.$store.commit('setToken','') |
| | | that.$store.commit('setUserInfo',{}) |
| | | that.$isResolve() |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | onHide: function() { |
| | | console.log('App Hide') |