Browse Source

refactor(App.vue): 将getUserInfo方法移至methods对象内

将getUserInfo方法从外部移动到methods对象内部,保持代码结构一致性
hfll
主管理员 1 week ago
parent
commit
f557be14ce
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      App.vue

+ 7
- 7
App.vue View File

@ -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)
}
},
}
</script>


Loading…
Cancel
Save