Files
decode-mini-app-v5/wx214944c362629fc7/pages/login/login.js
2024-08-22 12:47:21 +08:00

1 line
778 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var o=getApp();Page({data:{},onLoad:function(o){},getUserInfo:function(e){var n=this;o.getUserInfo(e,(function(){n.onNavigateBack()}))},getUserProfile:function(){console.log("getUserProfile");var e=this;try{wx.getUserProfile({lang:"zh_CN",desc:"获取用户相关信息",success:function(n){var t=n.userInfo;console.log("用户同意了授权"),console.log("userInfo",t),o.getUserInfo(t,(function(){e.onNavigateBack(1)}))},fail:function(){console.log("用户拒绝了授权")}})}catch(e){console.log("error",e.message),"wx.getUserProfile is not a function"===e.message?o.showError("wx.getUserProfile 接口无法使用,请升级到最新版微信"):o.showError(error.message)}},onNotLogin:function(){this.onNavigateBack()},onNavigateBack:function(){wx.navigateBack()}});