重构项目,方便开发
This commit is contained in:
16
frontend-vue/src/shared/utils/bootstrap.ts
Normal file
16
frontend-vue/src/shared/utils/bootstrap.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export interface BootstrapState {
|
||||
username?: string
|
||||
userId?: string
|
||||
isAdmin?: boolean
|
||||
error?: string
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__BOOTSTRAP__?: BootstrapState
|
||||
}
|
||||
}
|
||||
|
||||
export function getBootstrapState(): BootstrapState {
|
||||
return window.__BOOTSTRAP__ ?? {}
|
||||
}
|
||||
Reference in New Issue
Block a user