订单逻辑修改
This commit is contained in:
49
App.vue
49
App.vue
@@ -14,7 +14,9 @@
|
||||
uni.cache.set('menuInfo', uni.getMenuButtonBoundingClientRect());
|
||||
// #endif
|
||||
uni.cache.set('NAME', '零点八零');
|
||||
// this.$store.dispatch("loginEvent")
|
||||
if (!uni.cache.get('token')) {
|
||||
this.$store.dispatch("loginEvent")
|
||||
}
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
@@ -66,50 +68,7 @@
|
||||
// console.log('App Hide');
|
||||
},
|
||||
methods: {
|
||||
userlogin() {
|
||||
if (!uni.cache.get('token')) {
|
||||
// this.$store.dispatch("loginEvent"); //获取shapid
|
||||
uni.login({
|
||||
// #ifndef MP-WEIXIN
|
||||
provider: 'weixin',
|
||||
// #endif
|
||||
// #ifndef MP-ALIPAY
|
||||
provider: 'alipay',
|
||||
// #endif
|
||||
success: (data) => {
|
||||
uni.getUserInfo({
|
||||
// #ifndef MP-WEIXIN
|
||||
provider: 'weixin',
|
||||
// #endif
|
||||
// #ifndef MP-ALIPAY
|
||||
provider: 'alipay',
|
||||
// #endif
|
||||
success: async (infoRes) => {
|
||||
console.log(infoRes)
|
||||
let res = await Api.userwxlogin({
|
||||
code: data.code, //临时登录凭证
|
||||
rawData: infoRes.rawData,
|
||||
// #ifdef MP-WEIXIN
|
||||
source: 'wechat',
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
source: 'alipay',
|
||||
// #endif
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('token', res.data.token);
|
||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||
.miniAppOpenId)
|
||||
uni.cache.set('userInfo', res.data.userInfo);
|
||||
this.$isResolve()
|
||||
}
|
||||
},
|
||||
fail: (err) => {}
|
||||
});
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user