support exchange rate

This commit is contained in:
MaysWind
2020-11-18 01:19:57 +08:00
parent 9179d359bc
commit 805d77e721
14 changed files with 410 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
const exchangeRatesLocalStorageKey = 'lab_exchange_rates';
function getExchangeRates() {
const storageData = localStorage.getItem(exchangeRatesLocalStorageKey) || '{}';
return JSON.parse(storageData);
}
function setExchangeRates(value) {
const storageData = JSON.stringify(value);
localStorage.setItem(exchangeRatesLocalStorageKey, storageData);
}
function clearExchangeRates() {
localStorage.removeItem(exchangeRatesLocalStorageKey);
}
export default {
getExchangeRates,
setExchangeRates,
clearExchangeRates,
};