passman/js/app/services/cacheservice.js

22 lines
534 B
JavaScript
Raw Normal View History

2016-09-11 05:30:17 +08:00
'use strict';
/**
* @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-09-11 05:30:17 +08:00
}]);