修改第三方登录可能出现的bug

This commit is contained in:
lemon橪
2021-08-17 17:10:19 +08:00
parent d76bab4b71
commit 775bf3055d
4 changed files with 32 additions and 287 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view class="edition-intro">
<image src="https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png" class="logo" />
<image :src="config.logo" class="logo" />
<h1> {{config.name}}</h1>
<view class='version'>
<!-- #ifdef APP-PLUS -->
@@ -24,11 +24,11 @@
</u-cell-group>
<view class="intro">
<view>客服热线13161366885</view>
<view style="margin:20rpx 0 0 0;">客服邮箱lili@lili.com</view>
<view>{{config.customerServiceMobile ? `客服热线:${config.customerServiceMobile}` : ``}}</view>
<view style="margin:20rpx 0 0 0;">{{config.customerServiceEmail ? `客服邮箱:${config.customerServiceEmail}` : ``}}</view>
<view>
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=user')">lili商城用户协议</view>
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=user')">{{config.name}}用户协议</view>
<view>CopyRight @{{config.name}} </view>
</view>
</view>
@@ -54,6 +54,7 @@ export default {
};
},
onLoad() {
// #ifdef APP-PLUS
const platform = uni.getSystemInfoSync().platform;
/**
* 获取是否是安卓
@@ -72,6 +73,7 @@ export default {
version: inf.version,
};
});
// #endif
},
methods: {

View File

@@ -13,7 +13,7 @@
</template>
<script>
import { openIdLogin } from "@/api/connect.js";
import { openIdLogin } from "@/api/connect.js";
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
import { getUserInfo } from "@/api/members";
import storage from "@/utils/storage.js";
@@ -127,9 +127,9 @@ export default {
});
} else {
uni.showToast({
title: '配置有误请联系管理员',
title: "配置有误请联系管理员",
duration: 2000,
icon:"none"
icon: "none",
});
}
});
@@ -148,8 +148,8 @@ export default {
// #ifdef H5
let code = connectLogin.code;
let buyer = api.buyer;
window.open(buyer+`/connect/login/web/`+code, "_self");
let buyer = api.buyer;
window.open(buyer + `/connect/login/web/` + code, "_self");
// #endif
// #ifdef APP-PLUS
this.nonH5OpenId(connectLogin);
@@ -240,10 +240,25 @@ export default {
});
// 执行登录
getUserInfo().then((user) => {
storage.setUserInfo(user.data.result);
storage.setHasLogin(true);
if (user.data.success) {
/**
* 个人信息存储到缓存userInfo中
*/
storage.setUserInfo(user.data.result);
storage.setHasLogin(true);
/**
* 计算出当前router路径
* 1.如果跳转的链接为登录页面或跳转的链接为空页面。则会重新跳转到首页
* 2.都不满足返回跳转页面
*/
whetherNavigate();
} else {
uni.switchTab({
url: "/pages/tabbar/home/index",
});
}
});
whetherNavigate()
}
});
},