forked from zuoyanart/nodewebkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (45 loc) · 1.44 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>witch 货物管理系统</title>
<meta name="keywords" content=""/>
<meta name="description" content=""/>
<link rel="stylesheet" type="text/css" href="public/css/reset.css"/>
</head>
<body>
<ul class="m-login">
<li>用户名:<input type="text" id="uname"/></li>
<li>密 码:<input type="password" id="password"/></li>
<li><input type="button" value="登录" class="btn"/> </li>
</ul>
<script src="public/js/jquery-1.8.0.min.js"></script>
<script src="public/plug/layer/layer.min.js"></script>
<script>
var userApi=require('./dataApi/userApi.js'),
gui = require('nw.gui'),
config=require('./config/config.js');
$("#uname").focus();
$('.btn').bind('click',function() {
userApi.login($.trim($('#uname').val()), $.trim($('#password').val()),function(err,doc) {
if(err) {
layer.alert(err,8);
}
if(doc) {
//layer.alert(doc.id);
gui.Window.get().close();
gui.Window.open(config.server,{
width: window.screen.width,
height: window.screen.height,
toolbar: true
});
}
else {
layer.alert('用户名或密码错误');
}
});
});
//layer.alert('白菜级别前端攻城师贤心', 8);
</script>
</body>
</html>