diff options
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/login.js | 20 | ||||
-rw-r--r-- | src/login/login.model.js | 26 |
2 files changed, 46 insertions, 0 deletions
diff --git a/src/login/login.js b/src/login/login.js new file mode 100644 index 0000000..cc78fb4 --- /dev/null +++ b/src/login/login.js @@ -0,0 +1,20 @@ +define(['router', 'global', 'services', 'constants', 'login/login.model'], function(ROUTER, global, _services, CONSTANTS, LOGIN_MODEL) { + + + + var LOGIN_MODULE ={ + + var init:function(){ + + }, + login :function(){ + + + } + + + }; + + return LOGIN_MODULE; + +}) diff --git a/src/login/login.model.js b/src/login/login.model.js new file mode 100644 index 0000000..6729697 --- /dev/null +++ b/src/login/login.model.js @@ -0,0 +1,26 @@ +define([], function() { + + function LOGIN_MODEL() { + + this.loginData = {}; + } + + LOGIN_MODEL.prototype = { + + setData: function(data) { + this.loginData.token = data.tokenDetails.token; + this.loginData.username = data.tokenDetails.profile.username; + this.loginData.ManagerId = data.tokenDetails.profile.ranchid; + this.loginData.role = data.tokenDetails.profile.roles[0]; + UTILS.setLocalStorage('loginData', this.loginData); + }, + + getData: function(key) { + var localData = UTILS.getLocalStorage('loginData'); + return localData[key]; + } + }; + + return LOGIN_MODEL; + +}) |