const tool = {} /** * localStorage */ tool.data = { set(table, settings) { const _set = JSON.stringify(settings) return wx.setStorageSync(table, _set) }, get(table) { let data = wx.getStorageSync(table) try { data = JSON.parse(data) } catch (err) { return null } return data }, remove() { return wx.removeStorageSync(table) }, clear() { return wx.clearStorageSync() } } export default tool