zhoudw
2022-01-11 c0e42566062de9a13cefd5548d6f44ff2981d953
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function getParseItem(key) {
  try {
    const data = localStorage.getItem(`config_${key}`)
    return JSON.parse(data)
  } catch (e) {
    return null
  }
}
 
function setParseItem(key, value) {
  if (key && value) {
    localStorage.setItem(`config_${key}`, JSON.stringify(value))
  }
}
 
const cacheUtil = {
  getParseItem,
  setParseItem
}
 
export default cacheUtil