Commit fedd9caefbffd8689c94ca5c6a3a6c7bd90de197
1 parent
5bf90eea
wip: cache miss
Showing
5 changed files
with
8 additions
and
5 deletions
src/main.ts
... | ... | @@ -32,6 +32,9 @@ import { isDevMode } from '/@/utils/env'; |
32 | 32 | // Register global components |
33 | 33 | registerGlobComp(app); |
34 | 34 | |
35 | + // Multilingual configuration | |
36 | + await setupI18n(app); | |
37 | + | |
35 | 38 | // Configure routing |
36 | 39 | setupRouter(app); |
37 | 40 | |
... | ... | @@ -45,7 +48,7 @@ import { isDevMode } from '/@/utils/env'; |
45 | 48 | setupErrorHandle(app); |
46 | 49 | |
47 | 50 | // Mount when the route is ready |
48 | - await Promise.all([setupI18n(app), router.isReady()]); | |
51 | + await router.isReady(); | |
49 | 52 | |
50 | 53 | app.mount('#app', true); |
51 | 54 | ... | ... |
src/settings/projectSetting.ts
... | ... | @@ -23,7 +23,7 @@ const setting: ProjectConfig = { |
23 | 23 | permissionMode: PermissionModeEnum.ROLE, |
24 | 24 | |
25 | 25 | // Permission-related cache is stored in sessionStorage or localStorage |
26 | - permissionCacheType: CacheTypeEnum.SESSION, | |
26 | + permissionCacheType: CacheTypeEnum.LOCAL, | |
27 | 27 | |
28 | 28 | // color |
29 | 29 | themeColor: primaryColor, | ... | ... |
src/utils/auth/index.ts
src/utils/cache/memory.ts
src/utils/cache/persistent.ts
... | ... | @@ -69,7 +69,7 @@ export class Persistent { |
69 | 69 | |
70 | 70 | static setSession(key: SessionKeys, value: SessionStore[SessionKeys], immediate = false): void { |
71 | 71 | sessionMemory.set(key, toRaw(value)); |
72 | - immediate && ss.set(APP_SESSION_CACHE_KEY, sessionMemory); | |
72 | + immediate && ss.set(APP_SESSION_CACHE_KEY, sessionMemory.getCache); | |
73 | 73 | } |
74 | 74 | |
75 | 75 | static removeSession(key: SessionKeys): void { | ... | ... |