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 |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/SunshineLnsMinApp/pages/zhghLogin/zhghLogin.js b/SunshineLnsMinApp/pages/zhghLogin/zhghLogin.js
index ad70df2..4220fe7 100644
--- a/SunshineLnsMinApp/pages/zhghLogin/zhghLogin.js
+++ b/SunshineLnsMinApp/pages/zhghLogin/zhghLogin.js
@@ -8,16 +8,16 @@
   data: {
     src: app.globalData.imgUrl + '/image/bg1.jpg',
     logo: app.globalData.imgUrl + '/image/logo.png',
-    companyAccount: 'admin456',
-    companyPassword: 'admin'
+    companyAccount: '',
+    companyPassword: ''
   },
   /**
    * 生命周期函数--监听页面加载
    */
-  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