This commit is contained in:
2024-01-24 09:48:16 +08:00
parent b5200d750c
commit 89af95fc1f
2 changed files with 13 additions and 6 deletions

View File

@ -147,6 +147,13 @@
provider: 'weixin', provider: 'weixin',
success: function(loginRes) { success: function(loginRes) {
isRegistered(loginRes.code, that.phonecode).then(resp => { isRegistered(loginRes.code, that.phonecode).then(resp => {
if (!resp.data) {
that.$refs.uToast.show({
title: '登录失败',
type: 'error',
})
return
}
if (resp.data.openid && resp.data.phone) { if (resp.data.openid && resp.data.phone) {
uni.setStorageSync("openid", resp.data.openid) uni.setStorageSync("openid", resp.data.openid)
uni.setStorageSync("phone", resp.data.phone) uni.setStorageSync("phone", resp.data.phone)

View File

@ -48,12 +48,12 @@
// this.getAddress(); // this.getAddress();
createMobileToken().then(res => { createMobileToken().then(res => {
uni.setStorageSync("token", res.data.token) uni.setStorageSync("token", res.data.token)
})
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/homepage/homepage' url: '/pages/homepage/homepage'
}); });
}, 2000); }, 1000);
})
}, },
methods: { methods: {
// //