登录和分享优化

master
gongfuxiang 2023-12-16 00:01:18 +08:00
parent f59a74211b
commit cf579c12e9
2 changed files with 23 additions and 5 deletions

View File

@ -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 -->

View File

@ -1427,17 +1427,35 @@
// #ifdef APP
let self = this;
switch(type) {
// QQapple
// 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'));
},