mess_front.js
1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
* Created by Dell on 2018/9/4.
*/
/**
* 数据验证
* @param src 场景
* @returns {boolean}
*/
function inputCheck( src )
{
// 发表留言场景
if( src == 'mess' ){}
// 登录场景
if( src == 'login' ){
var name = $('#txtName').val();
var pwd = $('#txtPwd').val();
if( name == '' || pwd == '' ){
return false;
}
}
return true;
}
/**
* 留言信息提交
* @returns {boolean}
*/
function jumpSubmit()
{
if( !inputCheck('mess') ){
return false;
}
}
/**
* 用户登录提交
* @returns {boolean}
*/
function jumpLogin()
{
if( !inputCheck('login') ){
return false;
}
$.ajax({
url:'http://lys.com/wx5019b9c455ea9c81/Message/Api/User/UserLogin/Login',
type:'POST',
data:{
name:$('#txtName').val(),
pwd:$('#txtPwd').val()
},
dataType:'json',
success:function( data ){
if( data['result']['login_flg'] === true){
window.location = 'list.php';
}else{
return false;
}
},
error:function(e){
console.log('error: '+e);
}
});
//$('#frm_login').submit();
}