diff options
author | Indrajith K L | 2017-01-17 15:37:25 +0530 |
---|---|---|
committer | Indrajith K L | 2017-01-17 15:37:25 +0530 |
commit | 550e2f03ad0b60b3c9db3d68dbf014dcb740a2ff (patch) | |
tree | faf6bff0bdde8f01514a3f59ecca943569647c40 /src/login | |
download | InAppJSTemplate-550e2f03ad0b60b3c9db3d68dbf014dcb740a2ff.tar.gz InAppJSTemplate-550e2f03ad0b60b3c9db3d68dbf014dcb740a2ff.tar.bz2 InAppJSTemplate-550e2f03ad0b60b3c9db3d68dbf014dcb740a2ff.zip |
Initial Commit
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; + +}) |