Commit 372beb53e3ad6b8facaa5a27b95b964bb7c16ab9
1 parent
7a32d197
fix: fix clear persist storage bug
Showing
3 changed files
with
4 additions
and
2 deletions
... | ... | @@ -38,7 +38,7 @@ export function transformMenuModule(menuModule: MenuModule): Menu { |
38 | 38 | } |
39 | 39 | |
40 | 40 | export function transformRouteToMenu(routeModList: AppRouteModule[], routerMapping = false) { |
41 | - const cloneRouteModList = cloneDeep(routeModList); | |
41 | + const cloneRouteModList = cloneDeep(routeModList) ?? []; | |
42 | 42 | const routeList: AppRouteRecordRaw[] = []; |
43 | 43 | |
44 | 44 | cloneRouteModList.forEach((item) => { | ... | ... |
... | ... | @@ -115,6 +115,7 @@ window.addEventListener('beforeunload', function () { |
115 | 115 | REFRESH_TOKEN_KEY, |
116 | 116 | USER_INFO_KEY, |
117 | 117 | LOCK_INFO_KEY, |
118 | + ROLES_KEY, | |
118 | 119 | ]), |
119 | 120 | }); |
120 | 121 | ss.set(APP_SESSION_CACHE_KEY, { |
... | ... | @@ -125,6 +126,7 @@ window.addEventListener('beforeunload', function () { |
125 | 126 | REFRESH_TOKEN_KEY, |
126 | 127 | USER_INFO_KEY, |
127 | 128 | LOCK_INFO_KEY, |
129 | + ROLES_KEY, | |
128 | 130 | ]), |
129 | 131 | }); |
130 | 132 | }); | ... | ... |
... | ... | @@ -128,7 +128,7 @@ export function filter<T = any>( |
128 | 128 | config = getConfig(config); |
129 | 129 | const children = config.children as string; |
130 | 130 | function listFilter(list: T[]) { |
131 | - return list | |
131 | + return (list ?? []) | |
132 | 132 | .map((node: any) => ({ ...node })) |
133 | 133 | .filter((node) => { |
134 | 134 | node[children] = node[children] && listFilter(node[children]); | ... | ... |