From 6a970b8ec74fed89f94e24bef45fbeb7d23c9260 Mon Sep 17 00:00:00 2001
From: liuwh <hugeinfo123>
Date: Sat, 09 May 2020 10:48:17 +0800
Subject: [PATCH] 风险防控
---
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