From fe5963b9a8fc6f8de2e5441958e0524a9ec6e9c0 Mon Sep 17 00:00:00 2001 From: gadore Date: Tue, 26 Sep 2017 16:51:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/user.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/store/user.js b/src/store/user.js index 5f45e62..ec139b0 100644 --- a/src/store/user.js +++ b/src/store/user.js @@ -69,7 +69,6 @@ export default { }, user) { Vue.http.post(registerApi.url, registerApi.request).then(success => { log.log('ty') // TODO: 用promise返回状态 - // alert('注册成功!') }) } } From ba10b8d57a1f76659bfa4c9e155a7f0054018fad Mon Sep 17 00:00:00 2001 From: gadore Date: Tue, 26 Sep 2017 17:59:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Register.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Register.vue b/src/components/Register.vue index 1a48fa5..6791ba5 100644 --- a/src/components/Register.vue +++ b/src/components/Register.vue @@ -50,8 +50,14 @@ export default { ...mapActions([USER_REGISTER]), submit () { this.btn = false - if (this.user.password !== this.user.password1) { - this.openNotify('两次密码不一样!') + // console.info(this) + console.info(this.user.username) + if (this.user.username === '') { + this.openNotify('用户名不能为空') + } else if (this.user.password === '' || this.user.password === null) { + this.openNotify('密码不能为空') + } else if (this.user.password !== this.user.password1) { + this.openNotify('两次密码不相同') } else if (Boolean(this.user.username) && Boolean(this.user.password)) { this.USER_REGISTER(this.user) this.openNotify('注册成功,正在跳转')