diff options
Diffstat (limited to 'src/login/login.model.js')
-rw-r--r-- | src/login/login.model.js | 26 |
1 files changed, 26 insertions, 0 deletions
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; + +}) |