|
@@ -116,7 +116,15 @@ export default {
|
|
|
let res = await this.getQrcode();
|
|
|
this.$set(this, `qrcode`, res);
|
|
|
this.$set(this, `config`, { weixin: Vue.config.weixin, stomp: Vue.config.stomp });
|
|
|
- let uri = `/api/train/auth?redirect_uri=${Vue.config.weixin.target}/student/confirm?uid=${this.user.id}&type=1&qrcode=${res}`;
|
|
|
+ let user_id = this.user.id;
|
|
|
+ if (!user_id) {
|
|
|
+ let localuser = localStorage.getItem('user');
|
|
|
+ if (localuser) {
|
|
|
+ localuser = JSON.parse(localuser);
|
|
|
+ user_id = localuser.id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let uri = `/api/train/auth?redirect_uri=${Vue.config.weixin.target}/student/confirm?uid=${user_id}&type=1&qrcode=${res}`;
|
|
|
this.$set(this, `qrUri`, uri);
|
|
|
this.wxDialog = true;
|
|
|
},
|