zeanium-node
Advanced tools
Comparing version 0.8.5 to 0.9.0
{ | ||
"name": "zeanium-node", | ||
"version": "0.8.5", | ||
"version": "0.9.0", | ||
"description": "Zeanium for Node.js, simple http server and custome your business.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -42,3 +42,3 @@ /** | ||
zn.error('mysql.createConnection query error: ', err.stack); | ||
console.error(err.stack); | ||
console.log(err.stack); | ||
_defer.reject(err); | ||
@@ -68,3 +68,3 @@ }else { | ||
zn.error('ConnectionPool connection query error: ', err.stack); | ||
console.error(err.stack); | ||
console.log(err.stack); | ||
_defer.reject(err); | ||
@@ -87,3 +87,3 @@ }else { | ||
zn.error('ConnectionPool getConnection error: ', err.message); | ||
console.error(err.stack); | ||
console.log(err.stack); | ||
error && error(err); | ||
@@ -90,0 +90,0 @@ }else { |
@@ -41,11 +41,2 @@ /** | ||
} | ||
}, | ||
__getSessionGroup = function (){ | ||
if(zn._request){ | ||
return zn._request.getSessionValueByKey('zn_plugin_admin_group'); | ||
}else if(zn._oldRequest) { | ||
return zn._oldRequest.getSessionValueByKey('zn_plugin_admin_group'); | ||
}else { | ||
return 0; | ||
} | ||
}; | ||
@@ -169,3 +160,2 @@ | ||
_values = []; | ||
data.zn_plugin_admin_group = data.zn_plugin_admin_group || __getSessionGroup(); | ||
data.zn_create_user = data.zn_create_user || __getSessionId(); | ||
@@ -322,3 +312,3 @@ zn.each(data, function (value, key){ | ||
if(_return && addKeyWord !== false){ | ||
_return = "where zn_plugin_admin_group=" + __getSessionGroup() + " and " + _return; | ||
_return = 'where ' + _return; | ||
} | ||
@@ -325,0 +315,0 @@ |
@@ -6,20 +6,2 @@ /** | ||
var __getSessionId = function (){ | ||
if(zn._request){ | ||
return zn._request.getSessionValueByKey('id'); | ||
}else if(zn._oldRequest) { | ||
return zn._oldRequest.getSessionValueByKey('id'); | ||
}else { | ||
return 0; | ||
} | ||
}, __getSessionGroup = function (){ | ||
if(zn._request){ | ||
return zn._request.getSessionValueByKey('zn_plugin_admin_group'); | ||
}else if(zn._oldRequest) { | ||
return zn._oldRequest.getSessionValueByKey('zn_plugin_admin_group'); | ||
}else { | ||
return 0; | ||
} | ||
}; | ||
var __slice = Array.prototype.slice; | ||
@@ -31,5 +13,13 @@ var SQLS = { | ||
select : "select {fields} from {table} {where} {order} {group} {limit};", | ||
paging: "select {fields} from {table} {where} {order} {group} {limit};select count(id) as count from {table} {where};" | ||
paging: "select {fields} from {table} {where} {order} {group} {limit};select count(*) as count from {table} {where};" | ||
}, SQLS_DEFAULT = { | ||
fields: '*' | ||
}, __getSessionId = function (){ | ||
if(zn._request){ | ||
return zn._request.getSessionValueByKey('id'); | ||
}else if(zn._oldRequest) { | ||
return zn._oldRequest.getSessionValueByKey('id'); | ||
}else { | ||
return 0; | ||
} | ||
}; | ||
@@ -46,5 +36,2 @@ | ||
}, | ||
groupQuerySql: function (_group){ | ||
return " zn_plugin_admin_group={0} ".format(_group || __getSessionGroup()); | ||
}, | ||
paging: function (){ | ||
@@ -51,0 +38,0 @@ return __slice.call(arguments).map(function (data){ |
@@ -199,3 +199,3 @@ /** | ||
zn.error('Request.js: formidable.IncomingForm parse error, ' + error.toString()); | ||
console.error(error.stack || error); | ||
console.log(error.stack || error); | ||
} else { | ||
@@ -202,0 +202,0 @@ _data = _request.data = { |
280283
125
6558