tmp: 部分代码与UnishopV5结合,但是代码有严重缺陷
This commit is contained in:
13
App.vue
13
App.vue
@@ -40,7 +40,7 @@
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||
if (uni.getDeviceInfo().platform == 'ios') {
|
||||
uni.setStorageSync('initUrl', location.href);
|
||||
}
|
||||
// #endif
|
||||
@@ -151,7 +151,6 @@
|
||||
onShow: function(options) {
|
||||
// #ifdef MP
|
||||
// 自动授权登录
|
||||
this.getAuthInfo();
|
||||
if (this.$store.state.token) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/info',
|
||||
@@ -161,6 +160,8 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
this.getAuthInfo();
|
||||
}
|
||||
// #endif
|
||||
|
||||
@@ -177,8 +178,7 @@
|
||||
// #ifdef H5
|
||||
if (this.$util.isWeiXin()) {
|
||||
this.$util.getUrlCode(urlParams => {
|
||||
if (urlParams.source_member) uni.setStorageSync('source_member', urlParams
|
||||
.source_member);
|
||||
if (urlParams.source_member) uni.setStorageSync('source_member', urlParams.source_member);
|
||||
|
||||
if (urlParams.code == undefined) {
|
||||
this.$api.sendRequest({
|
||||
@@ -204,8 +204,7 @@
|
||||
let data = {};
|
||||
if (res.data.openid) data.wx_openid = res.data.openid;
|
||||
if (res.data.unionid) data.wx_unionid = res.data.unionid;
|
||||
if (res.data.userinfo) Object.assign(data, res.data
|
||||
.userinfo);
|
||||
if (res.data.userinfo) Object.assign(data, res.data.userinfo);
|
||||
this.authLogin(data);
|
||||
}
|
||||
}
|
||||
@@ -301,7 +300,7 @@
|
||||
this.shareConfig();
|
||||
}
|
||||
},
|
||||
// 代表在wacth里声明了firstName这个方法之后立即先去执行handler方法
|
||||
// 代表在watch里声明了firstName这个方法之后立即先去执行handler方法
|
||||
immediate: true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user