()
| 98 | |
| 99 | // 是否开启了获取用户名授权 |
| 100 | const getSetting = function() { |
| 101 | return new Promise((resolve,reject) => { |
| 102 | uni.getSetting({ |
| 103 | success:function(res) { |
| 104 | let authSetting=res.authSetting |
| 105 | if(authSetting['scope.userInfo']){resolve(1);return;}//授权成功 |
| 106 | if(authSetting['scope.userInfo']===false){resolve(0);return;}//拒绝授权 |
| 107 | resolve(2) //2未操作 |
| 108 | }, |
| 109 | fail:function() { reject("获取用户授权失败") } |
| 110 | }) |
| 111 | }) |
| 112 | } |
| 113 | |
| 114 | // 获取code |
| 115 | const getCode = provider => { |
nothing calls this directly
no outgoing calls
no test coverage detected