|
@@ -44,11 +44,21 @@ export default {
|
|
|
methods: {
|
|
|
...mapActions(['login', 'bind']),
|
|
|
async onSubmit(form) {
|
|
|
+ // form.openid = this.openid;
|
|
|
form.openid = this.openid;
|
|
|
let res = await this.bind(form);
|
|
|
- if (this.$checkRes(res, `绑定成功`)) {
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ this.$notify({
|
|
|
+ message: '绑定成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
sessionStorage.setItem('user', JSON.stringify(res.data));
|
|
|
window.history.replaceState({}, '首页', `${Vue.config.weixin.baseUrl}/api/train/auth?redirect_uri=${Vue.config.weixin.target}/login&type=0`);
|
|
|
+ } else {
|
|
|
+ this.$notify({
|
|
|
+ message: '绑定失败',
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
},
|