diff --git a/src/utils/tool.js b/src/utils/tool.js index aa63d40..7b36c1b 100644 --- a/src/utils/tool.js +++ b/src/utils/tool.js @@ -4,13 +4,14 @@ import CryptoJS from 'crypto-js'; import sysConfig from "@/config"; import store from '@/store' - - const tool = {} /* store */ tool.store = { set(key, data) { - return store.commit('setCache', {key:key, value:data}); + return store.commit('setCache', { + key: key, + value: data + }); }, get(key) { if (!Object.prototype.hasOwnProperty.call(store.state.cache.cacheList, key)) { @@ -25,7 +26,6 @@ tool.store = { return store.commit('clearCache'); } } - /* localStorage */ tool.data = { set(key, data, datetime = 0) { @@ -93,7 +93,7 @@ tool.cookie = { set(name, value, config = {}) { var cfg = { expires: null, - path: null, + path: '/', domain: null, secure: false, httpOnly: false,