diff --git a/App.vue b/App.vue index d7b6f99..830c256 100644 --- a/App.vue +++ b/App.vue @@ -17,7 +17,13 @@ console.error('获取二维码失败:', err); } }); - } + }, + async getUserInfo() { + const res = await this.$api.login.getUserInfo(); + if (res.code === 200) { + this.$store.dispatch('updateUserInfo', this.userInfo) + } + }, }, onLaunch() { // 提前获取二维码 @@ -40,12 +46,6 @@ onHide: function() { console.log('App Hide') }, - async getUserInfo() { - const res = await this.$api.login.getUserInfo(); - if (res.code === 200) { - this.$store.dispatch('updateUserInfo', this.userInfo) - } - }, }