2016-10-08 01:56:29 +08:00
|
|
|
(function () {
|
|
|
|
'use strict';
|
2016-09-11 05:30:17 +08:00
|
|
|
/**
|
|
|
|
* @ngdoc service
|
2016-09-16 03:21:34 +08:00
|
|
|
* @name passmanApp.CacheService
|
2016-09-11 05:30:17 +08:00
|
|
|
* @description
|
2016-09-16 03:21:34 +08:00
|
|
|
* # CacheService
|
2016-09-11 05:30:17 +08:00
|
|
|
* Service in the passmanApp.
|
|
|
|
*/
|
|
|
|
angular.module('passmanApp')
|
2016-09-25 23:36:03 +08:00
|
|
|
.service('CacheService', ['localStorageService', 'EncryptService', function (localStorageService, EncryptService) {
|
|
|
|
return {
|
|
|
|
get: function(name){
|
|
|
|
return EncryptService.decryptString(localStorageService.get(name));
|
|
|
|
},
|
|
|
|
set: function (key, value) {
|
|
|
|
value = EncryptService.encryptString(value);
|
|
|
|
localStorageService.set(key, value);
|
|
|
|
}
|
2016-10-08 01:56:29 +08:00
|
|
|
};
|
2016-09-11 05:30:17 +08:00
|
|
|
}]);
|
2016-10-08 01:56:29 +08:00
|
|
|
}());
|