同步操作将从 zero/WaitAdmin开源后台系统(Python版) 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const cacheUtil: any = {namespace: 'wait_',/*** 设置缓存** @param {string} key (键)* @param {any} value (值)* @param {number} expire (时效时长: 秒)* @returns {boolean}*/set(key: string, value: any, expire?: number): boolean {key = this.namespace + keylet data = valueif (expire) {const time: number = Math.round(new Date().getTime() / 1000)data = {expire: time + expire,value: value}}if (typeof data === 'object') {data = JSON.stringify(data)}try {window.localStorage.setItem(key, data)return true} catch (e) {return false}},/*** 获取缓存** @param key (键)* @param isShowExpire (是否显示过期时间)* @returns {any}*/get(key: string, isShowExpire: boolean = false): any {key = this.namespace + keyconst data: string | null = window.localStorage.getItem(key)if (data === undefined || data === null) {if (!isShowExpire) {return undefined}return { expire: undefined, value: undefined }}try {const time: number = Math.round(new Date().getTime() / 1000)const { value, expire } = JSON.parse(data)if (expire && expire < time) {window.localStorage.removeItem(key)return undefined}if (value) {if (!isShowExpire) {return value}return { expire, value }}const val = JSON.parse(data)if (val !== undefined) {return val}return data} catch (e) {return data}},/*** 移除缓存** @param key (键)* @returns {void}*/remove(key: string): void {key = this.namespace + keywindow.localStorage.removeItem(key)},/*** 清空缓存*/clear(): void {window.localStorage.clear()}}export default cacheUtil
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。