- export const setLoginType = (arr, type) => {
- traverse(arr)
- function traverse(list) {
- list.forEach(e => {
- if (!e.meta) e.meta = {}
- if (!e.meta.loginType) e.meta.loginType = type // 存在的话取e.meta.loginType,meta.loginType优先级高于这里默认的type
- if (e.children?.length) traverse(e.children)
- })
- }
- }
|