fix: can't access pages without permission via url (#826)

(cherry picked from commit 92e71c3b01fb63f26ab905249be03a85c546c4bd)
This commit is contained in:
chenos 2022-10-10 15:21:11 +08:00
parent fd21447810
commit fcccacfdf4

View File

@ -80,12 +80,22 @@ const MenuEditor = (props) => {
const s = findByUid(schema, defaultSelectedUid);
if (s) {
setTitle(s.title);
} else {
const s = findMenuItem(schema);
if (s) {
history.push(`/admin/${s['x-uid']}`);
setTitle(s.title);
} else {
history.push(`/admin/`);
}
}
} else {
const s = findMenuItem(schema);
if (s) {
history.push(`/admin/${s['x-uid']}`);
setTitle(s.title);
} else {
history.push(`/admin/`);
}
}
},