now user can login

This commit is contained in:
muerwre 2018-08-28 16:58:36 +07:00
parent e7960a6bf8
commit e19001ca82
25 changed files with 493 additions and 32844 deletions

25
src/utils/storage.js Normal file
View file

@ -0,0 +1,25 @@
const canStore = typeof window.localStorage !== 'undefined'
export const storeData = (key, data) => {
if (!canStore) return;
const value = JSON.stringify(data);
localStorage.setItem(key, value);
};
export const getData = key => {
if (!canStore) return;
let result = null;
try {
result = JSON.parse(localStorage.getItem(key));
} catch(e) {
result = null;
}
if (!result) return;
return result;
};