refactor(permission.ts): 优化typescript错误提示
This commit is contained in:
parent
58d3c0102f
commit
a61c2cc68a
|
|
@ -26,7 +26,7 @@ const hasPermission = (roles: string[], route: RouteRecordRaw) => {
|
|||
export const filterAsyncRoutes = (routes: RouteRecordRaw[], roles: string[]) => {
|
||||
const res: RouteRecordRaw[] = []
|
||||
routes.forEach(route => {
|
||||
const tmp = {...route}
|
||||
const tmp = {...route} as any
|
||||
if (hasPermission(roles, tmp)) {
|
||||
if (tmp.component == 'Layout') {
|
||||
tmp.component = Layout
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ export default defineComponent({
|
|||
const {path} = params
|
||||
useRouter().replace({path: '/' + path, query})
|
||||
},
|
||||
render(h) {
|
||||
return h()
|
||||
render() {
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue