App.vue 791 B

123456789101112131415161718192021222324252627282930
  1. <style lang="scss">
  2. /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
  3. @import "uview-ui/index.scss";
  4. </style>
  5. <script>
  6. export default {
  7. onLaunch: function() {
  8. let that = this;
  9. wx.login({
  10. success(re) {
  11. that.$api.wxLogin({code:re.code}).then(res=>{
  12. uni.setStorageSync('userInfo',res.data.data.userInfo)
  13. uni.setStorageSync('accessToken',res.data.data.access_token)
  14. uni.removeStorageSync('parent_member_id');
  15. })
  16. },
  17. })
  18. console.log('App Launch')
  19. },
  20. onShow: function() {
  21. console.log('App Show')
  22. },
  23. onHide: function() {
  24. console.log('App Hide')
  25. }
  26. }
  27. </script>