mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
[error] namespace.replace 添加提示
This commit is contained in:
parent
018b8c5391
commit
4de876c0e9
@ -38,15 +38,19 @@ export const useMenuStore = defineStore("menu", function () {
|
|||||||
function deep(d: any) {
|
function deep(d: any) {
|
||||||
if (typeof d == "object") {
|
if (typeof d == "object") {
|
||||||
if (d.permission) {
|
if (d.permission) {
|
||||||
|
if (d.namespace) {
|
||||||
d._permission = {};
|
d._permission = {};
|
||||||
for (const i in d.permission) {
|
for (const i in d.permission) {
|
||||||
d._permission[i] =
|
d._permission[i] =
|
||||||
list.findIndex((e: any) =>
|
list.findIndex((e) =>
|
||||||
e
|
e
|
||||||
.replace(/:/g, "/")
|
.replace(/:/g, "/")
|
||||||
.includes(`${d.namespace.replace("admin/", "")}/${i}`)
|
.includes(`${d.namespace.replace("admin/", "")}/${i}`)
|
||||||
) >= 0;
|
) >= 0;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
console.error("namespace is required", d);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for (const i in d) {
|
for (const i in d) {
|
||||||
deep(d[i]);
|
deep(d[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user