Commit 4ccde0d5 authored by youjie's avatar youjie

no message

parent a2f22a58
......@@ -112,6 +112,7 @@
uni.showLoading({
title:'尝试授权登陆'
})
console.log(res.code,'---')
methods.loginByOpenCode(res.code)
}
})
......@@ -129,18 +130,18 @@
uni.setStorageSync('wxUserAuthInfo',r.Data)
data.currentWxUserAuth=r.Data
if(r.Data.unionid){
methods.addFriend(r)
methods.addFriend()
}
}).catch(e=>{})
},
addFriend(r){
addFriend(){
data.loading = false
uni.showLoading()
let res = SetFriend({
SetFriend({
OldUnionId: data.shareUnionId,
NewUnionId: data.currentWxUserAuth.unionid
}).then(r=>{
if (r.Code==1) {
NewUnionId: data.currentWxUserAuth.unionid //'oV5Rm1J_MpkEVvE0VPEicwCDG1Zo'
}).then(res=>{
if (res.Code==1) {
uni.hideLoading()
data.loading = true
methods.setUserLoginByUnionId(data.currentWxUserAuth.unionid)
......@@ -148,7 +149,7 @@
uni.hideLoading()
data.loading = true
uni.showToast({
title: r.Message,
title: res.Message,
icon: "none",
});
}
......@@ -213,22 +214,25 @@
data.loading = true
})
},
async getData() {
getData() {
uni.showLoading()
let res = await GetUserInfoByUnionId({
GetUserInfoByUnionId({
Unionid:data.shareUnionId
});
if (res.Code==1) {
data.nickName = res.Data.WeChatName
}else{
uni.showToast({
title: res.Message,
icon: "none",
});
}).then(res => {
if (res.Code==1) {
data.nickName = res.Data.WeChatName
}else{
uni.showToast({
title: res.Message,
icon: "none",
});
}
uni.hideLoading()
}
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
})
},
};
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