passman/js/app/services/cacheservice.js

22 lines
555 B
JavaScript
Raw Normal View History

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')
.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
}());