|
|
|
@ -237,7 +237,7 @@ export const login = loginInfo => {
|
|
|
|
|
console.log('————————————————————') |
|
|
|
|
console.log('获取环境商') |
|
|
|
|
getProvider() |
|
|
|
|
.then(provider => { |
|
|
|
|
.then(async provider => { |
|
|
|
|
console.log('当前的环境商') |
|
|
|
|
console.log(provider) |
|
|
|
|
if (!provider) { |
|
|
|
@ -245,6 +245,11 @@ export const login = loginInfo => {
|
|
|
|
|
} |
|
|
|
|
// 调用登录接口
|
|
|
|
|
console.log('调用登录接口') |
|
|
|
|
let authorizeRes = await authorize('userInfo') |
|
|
|
|
if (!wx.getUserProfile && !authorizeRes) { |
|
|
|
|
reject('用户未授权') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
uni.login({ |
|
|
|
|
provider: provider, |
|
|
|
|
success: async function (loginRes) { |
|
|
|
@ -255,11 +260,6 @@ export const login = loginInfo => {
|
|
|
|
|
let code = loginRes.code |
|
|
|
|
cookie.set('wxLoginCode', loginRes.code) |
|
|
|
|
|
|
|
|
|
let authorizeRes = await authorize('userInfo') |
|
|
|
|
if (!wx.getUserProfile && !authorizeRes) { |
|
|
|
|
reject('用户未授权') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if (wx.getUserProfile) { |
|
|
|
|
if (loginInfo) { |
|
|
|
|
wxappAuth({ |
|
|
|
@ -286,7 +286,8 @@ export const login = loginInfo => {
|
|
|
|
|
reject('获取用户信息失败') |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
.catch(error => { // 登录接口调用失败
|
|
|
|
|
.catch(error => { |
|
|
|
|
// 登录接口调用失败
|
|
|
|
|
console.log(error) |
|
|
|
|
reject('登录接口调用失败') |
|
|
|
|
}) |
|
|
|
|