登录和分享优化
parent
f59a74211b
commit
cf579c12e9
|
|
@ -46,7 +46,7 @@
|
|||
<!-- #endif -->
|
||||
<!-- #ifdef H5 || APP -->
|
||||
<view class="share-items oh cp" @tap="share_url_copy_event">
|
||||
<image :src="common_static_url + 'share-user-icon.png'" mode="scaleToFill"></image>
|
||||
<image :src="common_static_url + 'share-url-icon.png'" mode="scaleToFill"></image>
|
||||
<text class="cr-grey text-size-xs single-text">点击复制地址分享给好友、群聊</text>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
|
|
|||
|
|
@ -1427,17 +1427,35 @@
|
|||
// #ifdef APP
|
||||
let self = this;
|
||||
switch(type) {
|
||||
// 微信、QQ、apple
|
||||
// 微信、QQ、谷歌
|
||||
case 'weixin' :
|
||||
case 'qq' :
|
||||
case 'google' :
|
||||
uni.login({
|
||||
provider: type,
|
||||
success: function(res) {
|
||||
let auth_result = res.authResult;
|
||||
self.app_login_bind_handle({...auth_result, ...{
|
||||
platform: type,
|
||||
openid: auth_result.openid,
|
||||
access_token: auth_result.access_token,
|
||||
}}, auth_result);
|
||||
},
|
||||
fail: function (error) {
|
||||
app.globalData.showToast(error.errMsg || '调用登录SDK失败');
|
||||
},
|
||||
});
|
||||
break;
|
||||
|
||||
// 苹果
|
||||
case 'apple' :
|
||||
uni.login({
|
||||
provider: type,
|
||||
success: function(res) {
|
||||
let auth_result = res.appleInfo || res.userInfo || res.authResult;
|
||||
let auth_result = res.appleInfo || res.userInfo;
|
||||
self.app_login_bind_handle({...auth_result, ...{
|
||||
platform: type,
|
||||
openid: auth_result.openid || auth_result.openId || auth_result.user,
|
||||
openid: auth_result.openId || auth_result.user,
|
||||
access_token: auth_result.access_token || ''
|
||||
}}, auth_result);
|
||||
},
|
||||
|
|
@ -1491,7 +1509,7 @@
|
|||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
fail: (res) => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error'));
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue