|
|
@@ -37,7 +37,15 @@ export default {
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.openId = options.openId
|
|
|
- uni.setStorageSync('openId', this.openId);
|
|
|
+ // 用户此时仍处于登录状态,立即调用绑定接口,而不是仅存缓存等下次密码登录才绑定
|
|
|
+ if (this.openId) {
|
|
|
+ uni.setStorageSync('openId', this.openId);
|
|
|
+ this.$Http.bindUserAndOpenId(this.openId).then(() => {
|
|
|
+ uni.removeStorageSync('openId');
|
|
|
+ }).catch(err => {
|
|
|
+ console.error('微信绑定失败', err);
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
// 退出登录
|