MCPcopy Create free account
hub / github.com/CoderOpen/waimai / getSetting

Function getSetting

front/common/authorize.js:100–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98
99// 是否开启了获取用户名授权
100const 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
115const getCode = provider => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected