feat(subsystem): 子系统卡片点击跳转到详情页
- 移除 SubsystemCard 直接打开外部链接的逻辑 - 点击卡片后路由跳转到 /subsystem/detail/:name - 用户需在详情页点击按钮后才会访问外部系统
This commit is contained in:
@@ -19,12 +19,15 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { subsystemApi, type Subsystem } from '@/api/subsystem'
|
import { useRouter } from 'vue-router'
|
||||||
|
import type { Subsystem } from '@/api/subsystem'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
system: Subsystem
|
system: Subsystem
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
const bgColor = computed(() => {
|
const bgColor = computed(() => {
|
||||||
const colors: Record<string, string> = {
|
const colors: Record<string, string> = {
|
||||||
W: 'var(--logo-w-bg)',
|
W: 'var(--logo-w-bg)',
|
||||||
@@ -51,13 +54,8 @@ const iconColor = computed(() => {
|
|||||||
return colors[props.system.icon] || 'var(--text-mid)'
|
return colors[props.system.icon] || 'var(--text-mid)'
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleClick = async () => {
|
const handleClick = () => {
|
||||||
if (props.system.sso_enabled) {
|
router.push(`/subsystem/detail/${props.system.name.toLowerCase()}`)
|
||||||
const { data } = await subsystemApi.getSSOUrl(props.system.id)
|
|
||||||
window.location.assign(data.sso_url)
|
|
||||||
} else {
|
|
||||||
window.open(props.system.url, '_blank')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user