index.vue 663 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <view class="container"></view>
  3. </template>
  4. <script>
  5. export default {
  6. data() {
  7. return {}
  8. },
  9. onLoad() {
  10. // this.shouquan()
  11. uni.switchTab({
  12. url: '/pages/home/home'
  13. })
  14. },
  15. methods: {
  16. //授权
  17. shouquan() {
  18. uni.login({
  19. provider: 'weixin', //使用微信登录
  20. success: function (loginRes) {
  21. console.log(loginRes)
  22. console.log(loginRes.authResult)
  23. uni.getUserProfile({
  24. desc: '用于完善用户资料',
  25. success: function (res) {
  26. console.log('res', res)
  27. }
  28. })
  29. }
  30. })
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. .container {
  37. height: 100vh;
  38. background-color: #fff;
  39. }
  40. </style>