Skip to content

Commit

Permalink
fix:添加内部 iframe 展示网页,优化 permission 代码
Browse files Browse the repository at this point in the history
  • Loading branch information
bypanghu committed Jan 20, 2025
1 parent ea7fa5c commit 0682000
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 18 deletions.
5 changes: 5 additions & 0 deletions web/src/permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ router.beforeEach(async (to, from) => {

// 设置页面标题
document.title = getPageTitle(to.meta.title, to)

if (to.meta.client) {
return true
}

// 白名单路由处理
if (WHITE_LIST.includes(to.name)) {
if (
Expand Down
18 changes: 12 additions & 6 deletions web/src/view/layout/aside/combinationMode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,18 @@
})
if (index === route.name) return
if (index.indexOf('http://') > -1 || index.indexOf('https://') > -1) {
query.url = decodeURIComponent(index)
router.push({
name: 'Iframe',
query,
params
})
if (index === 'Iframe') {
query.url = decodeURIComponent(index)
router.push({
name: 'Iframe',
query,
params
})
return
} else {
window.open(index, '_blank')
return
}
} else {
if (!top) {
router.push({ name: index, query, params })
Expand Down
18 changes: 12 additions & 6 deletions web/src/view/layout/aside/headMode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,18 @@
})
if (index === route.name) return
if (index.indexOf('http://') > -1 || index.indexOf('https://') > -1) {
query.url = decodeURIComponent(index)
router.push({
name: 'Iframe',
query,
params
})
if (index === 'Iframe') {
query.url = decodeURIComponent(index)
router.push({
name: 'Iframe',
query,
params
})
return
} else {
window.open(index, '_blank')
return
}
} else {
router.push({ name: index, query, params })
}
Expand Down
18 changes: 12 additions & 6 deletions web/src/view/layout/aside/normalMode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,18 @@
})
if (index === route.name) return
if (index.indexOf('http://') > -1 || index.indexOf('https://') > -1) {
query.url = decodeURIComponent(index)
router.push({
name: 'Iframe',
query,
params
})
if (index === 'Iframe') {
query.url = decodeURIComponent(index)
router.push({
name: 'Iframe',
query,
params
})
return
} else {
window.open(index, '_blank')
return
}
} else {
router.push({ name: index, query, params })
}
Expand Down

0 comments on commit 0682000

Please sign in to comment.