江西小程序管理端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.2 KiB

1 year ago
  1. <template>
  2. <view class="main">
  3. 登录方式
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. }
  11. },
  12. onLoad() {
  13. // this.init()
  14. },
  15. methods: {
  16. init() {
  17. uni.login({
  18. provider: 'weixin',
  19. "onlyAuthorize": true,
  20. success: function (loginRes) {
  21. console.log('11')
  22. console.log(loginRes)
  23. // 登录成功
  24. uni.getUserInfo({
  25. provider: 'weixin',
  26. success: function(info) {
  27. // 获取用户信息成功, info.authResult保存用户信息
  28. console.log('11')
  29. console.log(info)
  30. }
  31. })
  32. },
  33. fail: function (err) {
  34. // 登录授权失败
  35. // err.code是错误码
  36. }
  37. });
  38. },
  39. }
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. // .radioWrap {
  44. // display: flex;
  45. // justify-content: flex-start;
  46. // align-items: center;
  47. // /deep/.radio-btn {
  48. // margin-right: -9rpx !important;
  49. // }
  50. // radio {
  51. // zoom: .8;
  52. // }
  53. // view:nth-child(2) {
  54. // font-size: 24rpx;
  55. // color: #bfbfbf;
  56. // }
  57. // text {
  58. // color: #218DFF;
  59. // font-size: 24rpx;
  60. // }
  61. // }
  62. </style>