From de0151aaae18282e885e5ae2d84653d1131a65a4 Mon Sep 17 00:00:00 2001 From: liuwh <hugeinfo123> Date: Wed, 01 Apr 2020 11:26:42 +0800 Subject: [PATCH] xiufu --- SunshineLnsMinApp/pages/zhghLogin/zhghLogin.js | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/SunshineLnsMinApp/pages/zhghLogin/zhghLogin.js b/SunshineLnsMinApp/pages/zhghLogin/zhghLogin.js index 9eda973..4220fe7 100644 --- a/SunshineLnsMinApp/pages/zhghLogin/zhghLogin.js +++ b/SunshineLnsMinApp/pages/zhghLogin/zhghLogin.js @@ -14,10 +14,10 @@ /** * 生命周期函数--监听页面加载 */ - onLoad: function (options) {}, + onLoad: function(options) {}, // 输入框内容 - inputHandler: function (event) { + inputHandler: function(event) { var type = event.currentTarget.dataset['type']; console.log(type) console.log(event.detail.value) @@ -27,11 +27,23 @@ }, //登录 - simulationButton: function () { + simulationButton: function() { const { companyAccount, companyPassword } = this.data; + if (!companyAccount) { + return wx.showToast({ + title: '账号不能为空', + icon: 'none' + }) + } + if (!companyPassword) { + return wx.showToast({ + title: '密码不能为空', + icon: 'none' + }) + } let that = this; wx.request({ url: app.globalData.url + '/api/socialCompany/loginCheck', @@ -40,14 +52,14 @@ companyAccount, companyPassword }, - success: function (res) { + success: function(res) { console.log(res) if (res.data.code == 0) { wx.showToast({ title: '登录成功!', icon: 'success', duration: 1500, - success: function () { + success: function() { wx.setStorageSync('id', res.data.data.id) setTimeout(() => { wx.navigateTo({ -- Gitblit v1.8.0