fix: 嵌入式权限

This commit is contained in:
fit2cloud-chenyw
2023-12-28 18:49:02 +08:00
parent 7c1da38a76
commit 0307b1b3e9
8 changed files with 81 additions and 17 deletions

View File

@@ -1,12 +1,15 @@
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
export const check = (data, id?: string) => {
export const check = (data, id?: string, weight?: number) => {
if (!weight) {
weight = 1
}
if (!id) {
ElMessage.error('资源ID不能为空')
return false
}
const node = getNode(data, id)
if (!node) {
if (!node || node < weight) {
showMsg('无权访问当前资源是否离开当前页面系统将不保存您所做的更改', id)
return false
}