mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-10-07 16:00:26 +00:00
22 lines
549 B
Go
22 lines
549 B
Go
import { defineStore } from 'pinia';
|
|
import { AuthState } from '../interface';
|
|
import piniaPersistConfig from '@/config/pinia-persist';
|
|
|
|
export const AuthStore = defineStore({
|
|
id: 'AuthState',
|
|
state: (): AuthState => ({
|
|
authRouter: [],
|
|
}),
|
|
getters: {
|
|
dynamicRouter: (state) => {
|
|
return state.authRouter;
|
|
},
|
|
},
|
|
actions: {
|
|
async setAuthRouter(dynamicRouter: string[]) {
|
|
this.authRouter = dynamicRouter;
|
|
},
|
|
},
|
|
persist: piniaPersistConfig('AuthState'),
|
|
});
|