bind.js 489 B

12345678910111213141516171819202122232425
  1. const app = getApp()
  2. import Toast from '../..//vant/toast/toast';
  3. Page({
  4. /**
  5. * 用户登录
  6. */
  7. authorLogin: function (e) {
  8. let that = this;
  9. if (e.detail.errMsg !== 'getUserInfo:ok') {
  10. return false;
  11. }
  12. Toast.loading({
  13. mask: true,
  14. message: '帐号正在授权'
  15. });
  16. //登录返回上一页
  17. app.doLogin(e,function (isLogin) {
  18. if (isLogin) {
  19. wx.switchTab({
  20. url: '/pages/user/index'
  21. })
  22. }
  23. });
  24. }
  25. })