| | |
| | | // Register global components |
| | | registerGlobComp(app); |
| | | |
| | | // Multilingual configuration |
| | | await setupI18n(app); |
| | | |
| | | // Configure routing |
| | | setupRouter(app); |
| | | |
| | |
| | | setupErrorHandle(app); |
| | | |
| | | // Mount when the route is ready |
| | | await Promise.all([setupI18n(app), router.isReady()]); |
| | | await router.isReady(); |
| | | |
| | | app.mount('#app', true); |
| | | |
| | |
| | | permissionMode: PermissionModeEnum.ROLE, |
| | | |
| | | // Permission-related cache is stored in sessionStorage or localStorage |
| | | permissionCacheType: CacheTypeEnum.SESSION, |
| | | permissionCacheType: CacheTypeEnum.LOCAL, |
| | | |
| | | // color |
| | | themeColor: primaryColor, |
| | |
| | | |
| | | export function setAuthCache(key: BasicKeys, value) { |
| | | const fn = isLocal ? Persistent.setLocal : Persistent.setSession; |
| | | return fn(key, value); |
| | | return fn(key, value, true); |
| | | } |
| | |
| | | } |
| | | item.time = new Date().getTime() + this.alive; |
| | | item.timeoutId = setTimeout(() => { |
| | | this.remove(key); |
| | | // this.remove(key); |
| | | }, expires); |
| | | |
| | | return value; |
| | |
| | | |
| | | static setSession(key: SessionKeys, value: SessionStore[SessionKeys], immediate = false): void { |
| | | sessionMemory.set(key, toRaw(value)); |
| | | immediate && ss.set(APP_SESSION_CACHE_KEY, sessionMemory); |
| | | immediate && ss.set(APP_SESSION_CACHE_KEY, sessionMemory.getCache); |
| | | } |
| | | |
| | | static removeSession(key: SessionKeys): void { |