refactor(permission.ts): 优化typescript错误提示

This commit is contained in:
有来技术 2021-12-02 00:13:54 +08:00
parent 58d3c0102f
commit a61c2cc68a
2 changed files with 2 additions and 3 deletions

View File

@ -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

View File

@ -8,8 +8,7 @@ export default defineComponent({
const {path} = params
useRouter().replace({path: '/' + path, query})
},
render(h) {
return h()
render() {
}
})
</script>