|
@@ -75,12 +75,12 @@ const checkAuth = (list: menu[], path: string): menu => {
|
|
|
let out: menu = {}
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
const v = list[i]
|
|
|
- if (v.path === path) {
|
|
|
+ if (v.children) {
|
|
|
+ out = checkAuth(v.children, path)
|
|
|
+ if (out.path) break
|
|
|
+ } else if (v.path === path) {
|
|
|
out = v
|
|
|
break
|
|
|
- } else if (v.children) {
|
|
|
- out = checkAuth(v.children, path)
|
|
|
- if (out) break
|
|
|
}
|
|
|
}
|
|
|
return out
|