mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 添加生产的主题配置缓存
This commit is contained in:
@ -4,5 +4,4 @@ export * from './cache';
|
||||
export * from './auth';
|
||||
export * from './menu';
|
||||
export * from './breadcrumb';
|
||||
export * from './tab';
|
||||
export * from './regexp';
|
||||
|
@ -1,29 +0,0 @@
|
||||
import { EnumStorageKey } from '@/enum';
|
||||
import { setLocal, getLocal } from '../storage';
|
||||
|
||||
/** 缓存多页签数据 */
|
||||
export function setTabRoutes(data: GlobalTabRoute[]) {
|
||||
setLocal(EnumStorageKey['multi-tab-routes'], data);
|
||||
}
|
||||
|
||||
/** 获取缓存的多页签数据 */
|
||||
export function getTabRoutes() {
|
||||
const routes: GlobalTabRoute[] = [];
|
||||
const data = getLocal<GlobalTabRoute[]>(EnumStorageKey['multi-tab-routes']);
|
||||
if (data) {
|
||||
const defaultTabRoutes = data.map(item => ({
|
||||
...item,
|
||||
scrollPosition: {
|
||||
left: 0,
|
||||
top: 0
|
||||
}
|
||||
}));
|
||||
routes.push(...defaultTabRoutes);
|
||||
}
|
||||
return routes;
|
||||
}
|
||||
|
||||
/** 清空多页签数据 */
|
||||
export function clearTabRoutes() {
|
||||
setTabRoutes([]);
|
||||
}
|
Reference in New Issue
Block a user