添加后台管理框架雏形
This commit is contained in:
22
frontend/src/store/permiss.ts
Normal file
22
frontend/src/store/permiss.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import send_request from '../utils/send_request';
|
||||
|
||||
interface ObjectList {
|
||||
[key: string]: string[];
|
||||
}
|
||||
|
||||
export const usePermissStore = defineStore('permiss', {
|
||||
state: () => {
|
||||
const keys = localStorage.getItem('ms_keys');
|
||||
const defaultList = localStorage.getItem('ms_default_list');
|
||||
return {
|
||||
key: keys ? JSON.parse(keys) : <string[]>[],
|
||||
defaultList: JSON.stringify(defaultList)
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
handleSet(val: string[]) {
|
||||
this.key = val;
|
||||
}
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user