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',