mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
chore: code format
This commit is contained in:
@@ -10,5 +10,5 @@ function install(app: App, options: any = {}) {
|
||||
}
|
||||
|
||||
export default {
|
||||
install
|
||||
install,
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ import { request } from "/src/api/service";
|
||||
export async function getPermissions() {
|
||||
const ret = await request({
|
||||
url: "/sys/authority/user/permissions",
|
||||
method: "post"
|
||||
method: "post",
|
||||
});
|
||||
// 如果使用你自己的后端,需要在此处将返回结果改造为本模块需要的结构
|
||||
// 结构详情,请参考示例中打印的日志 ”获取权限数据成功:{...}“ (实际上就是“资源管理”页面中列出来的数据)
|
||||
|
||||
@@ -7,5 +7,5 @@ const install = function (app: any) {
|
||||
|
||||
export default {
|
||||
install,
|
||||
...permission
|
||||
...permission,
|
||||
};
|
||||
|
||||
@@ -7,5 +7,5 @@ export default {
|
||||
if (!hasPermission) {
|
||||
el.parentNode && el.parentNode.removeChild(el);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@ export * from "./errors";
|
||||
|
||||
export function usePermission() {
|
||||
return {
|
||||
...util
|
||||
...util,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -19,5 +19,5 @@ export default {
|
||||
// 通过路由守卫,在登录成功后拦截路由,从后台加载权限数据
|
||||
// 然后将权限数据转化为菜单和路由,添加到系统中
|
||||
registerRouterHook();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -56,7 +56,7 @@ export const usePermissionStore = defineStore({
|
||||
id: "app.permission",
|
||||
state: (): PermissionState => ({
|
||||
permissions: [],
|
||||
inited: false
|
||||
inited: false,
|
||||
}),
|
||||
getters: {
|
||||
// @ts-ignore
|
||||
@@ -68,7 +68,7 @@ export const usePermissionStore = defineStore({
|
||||
isInited() {
|
||||
// @ts-ignore
|
||||
return this.inited;
|
||||
}
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
init({ permissions }: any) {
|
||||
@@ -101,6 +101,6 @@ export const usePermissionStore = defineStore({
|
||||
}
|
||||
}
|
||||
this.resolve(permissionTree);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -47,16 +47,16 @@ export function useCrudPermission({ permission }: UseCrudPermissionProps) {
|
||||
{
|
||||
actionbar: {
|
||||
buttons: {
|
||||
add: { show: hasActionPermission("add") }
|
||||
}
|
||||
add: { show: hasActionPermission("add") },
|
||||
},
|
||||
},
|
||||
rowHandle: {
|
||||
buttons: {
|
||||
edit: { show: hasActionPermission("edit") },
|
||||
remove: { show: hasActionPermission("remove") },
|
||||
view: { show: hasActionPermission("view") }
|
||||
}
|
||||
}
|
||||
view: { show: hasActionPermission("view") },
|
||||
},
|
||||
},
|
||||
},
|
||||
extra
|
||||
);
|
||||
|
||||
@@ -26,7 +26,7 @@ const util = {
|
||||
message.error("对不起,您没有权限执行此操作");
|
||||
throw new NoPermissionError();
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default util;
|
||||
|
||||
Reference in New Issue
Block a user