From 492656c66c9b501f0e8f425f664fbdeb4ab1fecf Mon Sep 17 00:00:00 2001 From: Ge Hao Date: Sat, 7 Jan 2017 10:38:33 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20=E4=B8=80=E4=B8=AAurl=E9=94=99?= =?UTF-8?q?=E8=AF=AF=EF=BC=8C=E8=BF=98=E6=9C=89=E7=99=BB=E5=BD=95=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- pages/mine/mine.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index b331327..6f270c5 100644 --- a/app.js +++ b/app.js @@ -86,7 +86,7 @@ App({ } that.globalData.token = token that.request({ - url: `${that.globalData.API_URL}/sessions/new`, + url: `${that.globalData.API_URL}/sessions/login`, data: {code: that.globalData.code}, success: function(res) { if (!res.data.token) { diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 827e87c..3d2cabe 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -100,6 +100,7 @@ Page({ bindLoginMobilecode: function(e) { if (!this.bindCheckMobile(this.data.mobile)) { return } + if (!(e.detail.value.code && e.detail.value.code.length === 4)) { return } wx.showToast({ title: '登录中...', icon: 'loading', @@ -112,6 +113,14 @@ Page({ bindLoginPassword: function(e) { var mobile = e.detail.value.mobile if (!this.bindCheckMobile(mobile)) { return } + if (!e.detail.value.password) { + wx.showModal({ + title: '错误', + content: '请输入密码' + }) + return + } + wx.showToast({ title: '登录中...', icon: 'loading',