20 lines
528 B
JavaScript
20 lines
528 B
JavaScript
import starCloudInstance from '../star-cloud'
|
|
|
|
export function setStorageWeb(key, value) {
|
|
return localStorage.setItem(getPrefix() + key, JSON.stringify(value))
|
|
}
|
|
|
|
export function getStorageWeb(key) {
|
|
const value = localStorage.getItem(getPrefix() + key)
|
|
return value ? JSON.parse(value) : null
|
|
}
|
|
|
|
export function removeStorageWeb(key) {
|
|
return localStorage.removeItem(getPrefix() + key)
|
|
}
|
|
|
|
function getPrefix() {
|
|
const starCloud = starCloudInstance
|
|
return starCloud?.envVersion ? `${starCloud?.envVersion}:` : ''
|
|
}
|