mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
chore: 集成vben
This commit is contained in:
@@ -7,15 +7,17 @@ import Empty from "ant-design-vue/es/empty";
|
||||
import Avatar from "ant-design-vue/es/avatar";
|
||||
import Steps from "ant-design-vue/es/steps";
|
||||
import Select from "ant-design-vue/es/select";
|
||||
import PageHeader from "ant-design-vue/es/page-header";
|
||||
|
||||
export default {
|
||||
install(app: any) {
|
||||
app.use(Input);
|
||||
app.use(Button);
|
||||
app.component("ADivider", Divider);
|
||||
app.component("ABadge", Badge);
|
||||
app.component("AEmpty", Empty);
|
||||
app.component("AAvatar", Avatar);
|
||||
app.use(Divider);
|
||||
app.use(Badge);
|
||||
app.use(Empty);
|
||||
app.use(Avatar);
|
||||
app.use(PageHeader);
|
||||
app.use(Steps);
|
||||
app.use(Select);
|
||||
|
||||
@@ -165,8 +167,8 @@ export default {
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/tree-select"))
|
||||
);
|
||||
app.component(
|
||||
"AToar",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/tree-select"))
|
||||
"ATour",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/tour"))
|
||||
);
|
||||
|
||||
app.component(
|
||||
@@ -186,5 +188,40 @@ export default {
|
||||
"AProgress",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/progress"))
|
||||
);
|
||||
app.component(
|
||||
"ATimelineItem",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/timeline/TimelineItem"))
|
||||
);
|
||||
app.component(
|
||||
"ATimeline",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/timeline/Timeline"))
|
||||
);
|
||||
app.component(
|
||||
"APageHeader",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/page-header/index"))
|
||||
);
|
||||
app.component(
|
||||
"APopover",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/popover"))
|
||||
);
|
||||
app.component(
|
||||
"APopconfirm",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/popconfirm"))
|
||||
);
|
||||
app.component(
|
||||
"ACollapse",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/collapse"))
|
||||
);
|
||||
app.component(
|
||||
"ADescriptions",
|
||||
defineAsyncComponent(() => import("ant-design-vue/es/descriptions"))
|
||||
);
|
||||
app.component(
|
||||
"ADescriptionsItem",
|
||||
defineAsyncComponent(async () => {
|
||||
const m = await import("ant-design-vue/es/descriptions/");
|
||||
return m.DescriptionsItem;
|
||||
})
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -28,7 +28,6 @@ export function registerRouterHook() {
|
||||
if (!token || token === "undefined") {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 初始化权限列表
|
||||
try {
|
||||
console.log("permission is enabled");
|
||||
|
||||
@@ -4,17 +4,25 @@ import { getPermissions } from "./api";
|
||||
import { mitter } from "/@/utils/util.mitt";
|
||||
import { env } from "/@/utils/util.env";
|
||||
import { useAccessStore } from "/@/vben/stores";
|
||||
import { eachTree } from "/@/utils/util.tree";
|
||||
import util from "/@/plugin/permission/util.permission";
|
||||
|
||||
//监听注销事件
|
||||
mitter.on("app.logout", () => {
|
||||
const permissionStore = usePermissionStore();
|
||||
permissionStore.clear();
|
||||
const accessStore = useAccessStore();
|
||||
accessStore.setIsAccessChecked(false);
|
||||
});
|
||||
|
||||
mitter.on("app.login", () => {
|
||||
const permissionStore = useResourceStore();
|
||||
const accessStore = useAccessStore();
|
||||
accessStore.setIsAccessChecked(false);
|
||||
const permissionStore = usePermissionStore();
|
||||
permissionStore.clear();
|
||||
permissionStore.init();
|
||||
// const accessStore = useAccessStore();
|
||||
// accessStore.setAccessCode([]);
|
||||
// permissionStore.init();
|
||||
});
|
||||
|
||||
interface PermissionState {
|
||||
@@ -28,7 +36,7 @@ interface PermissionState {
|
||||
* @param permissionList
|
||||
* @returns {*}
|
||||
*/
|
||||
function formatPermissions(menuTree: Array<any>, permissionList: any[] = []) {
|
||||
export function formatPermissions(menuTree: Array<any>, permissionList: any[] = []) {
|
||||
if (menuTree == null) {
|
||||
menuTree = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user