mirror of
https://github.com/nextcloud/passman.git
synced 2024-11-14 11:57:38 +08:00
21 lines
534 B
JavaScript
21 lines
534 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* @ngdoc service
|
|
* @name passmanApp.CacheService
|
|
* @description
|
|
* # CacheService
|
|
* 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);
|
|
}
|
|
}
|
|
}]);
|