zeanium-node
Advanced tools
Comparing version 0.6.32 to 0.6.33
{ | ||
"name": "zeanium-node", | ||
"version": "0.6.32", | ||
"version": "0.6.33", | ||
"description": "Zeanium for Node.js, simple http server and custome your business.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,4 +10,4 @@ zn.define([ | ||
model: model | ||
} | ||
}; | ||
}); |
@@ -38,3 +38,3 @@ zn.define(function () { | ||
get: function (){ | ||
return zn._request.getSessionKeyValue('@AdminUser', 'id'); | ||
return zn._request.getSessionValueByKey('id'); | ||
}, | ||
@@ -60,3 +60,3 @@ default: 0 | ||
auto_update: function (){ | ||
return zn._request.getSessionKeyValue('@AdminUser', 'id'); | ||
return zn._request.getSessionValueByKey('id'); | ||
}, | ||
@@ -63,0 +63,0 @@ default: 0 |
@@ -60,3 +60,3 @@ /** | ||
if(value){ | ||
return "zn_user_exist({0}, users, roles) <> 0".format(zn._request.getSessionKeyValue('@AdminUser', 'id')); | ||
return "zn_user_exist({0}, users, roles) <> 0".format(zn._request.getSessionValueByKey('id')); | ||
}else { | ||
@@ -63,0 +63,0 @@ return ""; |
@@ -64,2 +64,3 @@ zn.define([ | ||
watchCwd: '/src/', | ||
defaultSessionKey: '@ZNPluginAdminUserSession', | ||
views: { | ||
@@ -66,0 +67,0 @@ path: '/src/view/', |
@@ -27,2 +27,3 @@ /** | ||
}, | ||
defaultSessionKey: '@ZNPluginAdminUserSession', | ||
serverRequest: { | ||
@@ -46,2 +47,3 @@ value: null, | ||
this._context = context; | ||
this.set('defaultSessionKey', context.config.defaultSessionKey || "@ZNPluginAdminUserSession"); | ||
this.serverRequest = serverRequest; | ||
@@ -56,8 +58,8 @@ }, | ||
}, | ||
getSessionKeyValue: function (sessionKey, key){ | ||
getSessionValueByKey: function (key, sessionKey){ | ||
var _session = this._session, | ||
_sessionKey = sessionKey || '@AdminUser'; | ||
_sessionKey = sessionKey || this.get('defaultSessionKey'); | ||
if(_session.hasItem()){ | ||
if(_session.getItem(_sessionKey)){ | ||
return _session.getItem(_sessionKey)[key]||0; | ||
return _session.getItem(_sessionKey)[key] || 0; | ||
}else { | ||
@@ -70,2 +72,8 @@ return 0; | ||
}, | ||
setSession: function (session, sessionKey){ | ||
return this._session.setItem(sessionKey || this.get('defaultSessionKey'), session), this; | ||
}, | ||
getSession: function (sessionKey){ | ||
return this._session.getItem(sessionKey || this.get('defaultSessionKey')); | ||
}, | ||
getJSON: function (inName){ | ||
@@ -72,0 +80,0 @@ var _value = this.getValue(inName); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
259306
6062