Commit 4ccde0d5 authored by youjie's avatar youjie

no message

parent a2f22a58
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
uni.showLoading({ uni.showLoading({
title:'尝试授权登陆' title:'尝试授权登陆'
}) })
console.log(res.code,'---')
methods.loginByOpenCode(res.code) methods.loginByOpenCode(res.code)
} }
}) })
...@@ -129,18 +130,18 @@ ...@@ -129,18 +130,18 @@
uni.setStorageSync('wxUserAuthInfo',r.Data) uni.setStorageSync('wxUserAuthInfo',r.Data)
data.currentWxUserAuth=r.Data data.currentWxUserAuth=r.Data
if(r.Data.unionid){ if(r.Data.unionid){
methods.addFriend(r) methods.addFriend()
} }
}).catch(e=>{}) }).catch(e=>{})
}, },
addFriend(r){ addFriend(){
data.loading = false data.loading = false
uni.showLoading() uni.showLoading()
let res = SetFriend({ SetFriend({
OldUnionId: data.shareUnionId, OldUnionId: data.shareUnionId,
NewUnionId: data.currentWxUserAuth.unionid NewUnionId: data.currentWxUserAuth.unionid //'oV5Rm1J_MpkEVvE0VPEicwCDG1Zo'
}).then(r=>{ }).then(res=>{
if (r.Code==1) { if (res.Code==1) {
uni.hideLoading() uni.hideLoading()
data.loading = true data.loading = true
methods.setUserLoginByUnionId(data.currentWxUserAuth.unionid) methods.setUserLoginByUnionId(data.currentWxUserAuth.unionid)
...@@ -148,7 +149,7 @@ ...@@ -148,7 +149,7 @@
uni.hideLoading() uni.hideLoading()
data.loading = true data.loading = true
uni.showToast({ uni.showToast({
title: r.Message, title: res.Message,
icon: "none", icon: "none",
}); });
} }
...@@ -213,22 +214,25 @@ ...@@ -213,22 +214,25 @@
data.loading = true data.loading = true
}) })
}, },
async getData() { getData() {
uni.showLoading() uni.showLoading()
let res = await GetUserInfoByUnionId({ GetUserInfoByUnionId({
Unionid:data.shareUnionId Unionid:data.shareUnionId
}); }).then(res => {
if (res.Code==1) { if (res.Code==1) {
data.nickName = res.Data.WeChatName data.nickName = res.Data.WeChatName
}else{
}else{ uni.showToast({
uni.showToast({ title: res.Message,
title: res.Message, icon: "none",
icon: "none", });
});
}
uni.hideLoading()
} }).catch(e => {
uni.hideLoading() uni.hideLoading()
})
}, },
}; };
return { return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment