Commit b77a7cab authored by nick zheng's avatar nick zheng

chore: 首页跳转

parent 82b9d66c
......@@ -15,4 +15,9 @@ export const Domain_Name: Record<'DEV' | 'PROD', string> = {
PROD: 'super-modellink.gsstcloud.com',
}
export const DOMAIN_ORIGIN: Record<'DEV' | 'PROD', string> = {
DEV: 'https://poc-sit.gsstcloud.com',
PROD: 'https://model-link.gsstcloud.com',
}
export const TEXTTOSPEECH_WS_URL = `wss://${Domain_Name[ENV || 'DEV']}/websocket/textToSpeechTC.ws`
......@@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n'
import { Plus, Logout, Me, TransactionOrder } from '@icon-park/vue-next'
import type { MenuOption } from 'naive-ui'
import { useUserStore } from '@/store/modules/user'
import { DOMAIN_ORIGIN } from '@/config/base-url'
// import LanguageSetting from '@/components/language-setting/language-setting.vue'
const { t } = useI18n()
......@@ -21,7 +22,7 @@ const currentMenuValue = ref('')
const menuOptions = computed<MenuOption[]>(() => {
return [
{
label: () => h('div', {}, t('router_title_module.home')),
label: () => h('div', {}, t('common_module.back_home')),
key: 'Home',
icon: () => h('i', { class: 'iconfont icon-home' }),
},
......@@ -109,6 +110,12 @@ function handleToLogin() {
}
function handleMenuValueChange(key: string) {
if (key === 'Home') {
const ENV = import.meta.env.VITE_APP_ENV
window.open(`${DOMAIN_ORIGIN[ENV || 'DEV']}/admin/intelligent-application-platform/home`, '_self')
return
}
router.push({ name: key })
}
......
......@@ -2,6 +2,7 @@
import { ref, watchEffect } from 'vue'
import Sidebar from './components/sidebar/sidebar.vue'
import { useRoute } from 'vue-router'
import { DOMAIN_ORIGIN } from '@/config/base-url'
const route = useRoute()
......@@ -11,6 +12,8 @@ const isShowMainContentContainerPadding = ref(true)
watchEffect(() => {
if (route.name === 'Home') {
const ENV = import.meta.env.VITE_APP_ENV
window.open(`${DOMAIN_ORIGIN[ENV || 'DEV']}/admin/intelligent-application-platform/home`, '_self')
isShowMainContentContainerPadding.value = false
} else if (!isShowMainContentContainerPadding.value) {
isShowMainContentContainerPadding.value = true
......
......@@ -168,6 +168,7 @@ common_module:
mermaid_render_error: 'There is an error in the chart rendering. Please ask again'
mermaid_rendering: 'The chart is being rendered...'
example: 'Ex.'
back_home: 'Back to home'
dialogue_module:
continue_question_message: 'You can keep asking questions'
......@@ -320,7 +321,7 @@ home_module:
business_marketing_list:
t_title_1: 'Event planning'
t_doc_1: 'Efficiently customize various planning schemes'
t_template_1: "I am an [[event planner]], please help me write a proposal for a [[music exchange event]], including but not limited to the planning theme, planning objectives, detailed plan, required resources, planning budget, risk management, and effectiveness evaluation."
t_template_1: 'I am an [[event planner]], please help me write a proposal for a [[music exchange event]], including but not limited to the planning theme, planning objectives, detailed plan, required resources, planning budget, risk management, and effectiveness evaluation.'
t_title_2: 'Market research'
t_doc_2: 'Accurate insight into the market'
......
......@@ -167,6 +167,7 @@ common_module:
mermaid_render_error: '图表渲染出错了,请重新提问'
mermaid_rendering: '图表正在渲染中...'
example: '示例'
back_home: '返回首页'
dialogue_module:
continue_question_message: '你可以继续提问'
......
......@@ -167,6 +167,7 @@ common_module:
mermaid_render_error: '圖表渲染出錯了,請重新提問'
mermaid_rendering: '圖表正在渲染中...'
example: '示例'
back_home: '返回首頁'
dialogue_module:
continue_question_message: '你可以繼續提問'
......
......@@ -11,7 +11,7 @@ export default [
title: '',
},
component: Layout,
redirect: '/home',
redirect: '/personal-space',
children: [
{
path: '/home',
......
......@@ -128,7 +128,7 @@ async function handleGetApplicationDetail() {
}
})
.catch(() => {
router.replace({ name: 'Home' })
router.replace({ name: 'Root' })
})
}
......
......@@ -68,7 +68,7 @@ async function handleGetAgentDetail(agentId: string) {
}
})
.catch(() => {
router.replace({ name: 'Home' })
router.replace({ name: 'Root' })
})
}
......
......@@ -113,7 +113,7 @@ onMounted(async () => {
return
}
router.replace({ name: 'Home' })
router.replace({ name: 'Root' })
})
onUnmounted(() => {
......@@ -129,7 +129,7 @@ async function handleGetApplicationDetail() {
document.title = agentApplicationConfig.value.baseInfo.agentTitle
})
.catch(() => {
router.replace({ name: 'Home' })
router.replace({ name: 'Root' })
})
}
......
......@@ -170,7 +170,7 @@ onMounted(async () => {
return
}
router.replace({ name: 'Home' })
router.replace({ name: 'Root' })
})
onUnmounted(() => {
......@@ -193,7 +193,7 @@ async function handleGetApplicationDetail() {
}
})
.catch(() => {
router.replace({ name: 'Home' })
router.replace({ name: 'Root' })
})
}
......@@ -224,7 +224,7 @@ function getAutoPlayByAgentId() {
function handleBack() {
if (!history.state.back) {
router.replace({
name: 'Home',
name: 'Root',
})
} else {
router.back()
......
......@@ -167,6 +167,7 @@ declare namespace I18n {
mermaid_render_error: string
mermaid_rendering: string
example: string
back_home: string
dialogue_module: {
continue_question_message: string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment