Skip to content

Commit 75103a9

Browse files
committed
添加配置文件
1 parent ea4df95 commit 75103a9

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

config/config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
module.exports = {
3+
4+
server:'http://127.0.0.1:3000/',
5+
//redis配置
6+
redisPort:'6379',
7+
redisIp:'192.168.1.207',
8+
redisMaxPoll:500,//redis最大连接池
9+
redisTimeOut:600000,//连接过期时间,过期连接将被删除//单位ms//现在定义为10分钟
10+
redisDataBase:1//默认使用的redis数据库下标,默认从0开始
11+
}

index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<script src="public/js/jquery-1.8.0.min.js"></script>
1717
<script src="public/plug/layer/layer.min.js"></script>
1818
<script>
19-
var
20-
userApi=require('./dataApi/userApi.js');
21-
gui = require('nw.gui');
22-
19+
var userApi=require('./dataApi/userApi.js'),
20+
gui = require('nw.gui'),
21+
config=require('./config/config.js');
22+
$("#uname").focus();
2323
$('.btn').bind('click',function() {
2424
userApi.login($.trim($('#uname').val()), $.trim($('#password').val()),function(err,doc) {
2525
if(err) {
@@ -28,10 +28,10 @@
2828
if(doc) {
2929
//layer.alert(doc.id);
3030
gui.Window.get().close();
31-
gui.Window.open('main.html',{
31+
gui.Window.open(config.server,{
3232
width: window.screen.width,
3333
height: window.screen.height,
34-
toolbar: false
34+
toolbar: true
3535
});
3636
}
3737
else {

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nw-demo",
3-
"main": "http://127.0.0.1:3000/",
3+
"main": "index.html",
44
"window": {
55
"toolbar": true,
66
"width": 800,
@@ -10,7 +10,6 @@
1010
"dependencies": {
1111
"ejs" : "*",
1212
"xss" : "*",
13-
"async" : "*",
14-
"orm" : "*"
13+
"async" : "*"
1514
}
1615
}

start.bat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
@ECHO ON
2-
cd H:\nodejs\nodewebkit
2+
cd f:\nodejs\nodewebkit
33
nw.exe
4-
pause

0 commit comments

Comments
 (0)