|
@@ -44,21 +44,11 @@ export default {
|
|
|
methods: {
|
|
|
...mapActions(['login', 'bind']),
|
|
|
async onSubmit(form) {
|
|
|
- // form.openid = this.openid;
|
|
|
form.openid = this.openid;
|
|
|
let res = await this.bind(form);
|
|
|
- if (res.errcode === 0) {
|
|
|
- this.$notify({
|
|
|
- message: '绑定成功',
|
|
|
- type: 'success',
|
|
|
- });
|
|
|
+ if (this.$checkRes(res, `绑定成功`)) {
|
|
|
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',
|
|
|
- });
|
|
|
}
|
|
|
},
|
|
|
},
|