C端小程序
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

40 行
924 B

  1. var config = require('../../config/config.js');
  2. var Common = require('../../common/common.js');
  3. var app = getApp();
  4. Page({
  5. data: {
  6. canIUse: wx.canIUse('button.open-type.getUserInfo')
  7. },
  8. onLoad: function(options) {
  9. var that = this;
  10. },
  11. bindGetUserInfo: function(e) {
  12. console.log(e);
  13. var iv = e.detail.iv;
  14. var encryptedData = e.detail.encryptedData;
  15. console.log(iv)
  16. console.log(encryptedData)
  17. Common.getUserInfo(encryptedData, iv)
  18. .then(res => {
  19. console.log(res);
  20. /**
  21. * 1:用户拒绝授权
  22. * 0:用户同意授权
  23. */
  24. if(res.data.code == 0){
  25. //返回主页
  26. wx.redirectTo({
  27. url: '../index/index',
  28. })
  29. }
  30. else if(res.data.code == 1){
  31. wx.showToast({
  32. title: '请授权个人信息',
  33. icon:"none"
  34. })
  35. }
  36. })
  37. }
  38. })