|
@@ -1,8 +1,10 @@
|
|
|
<script lang='ts' setup>
|
|
|
-
|
|
|
import { Api } from '@/api/model/url'
|
|
|
import { useCommonStore } from '@/stores/modules/common'
|
|
|
|
|
|
+const config = useRuntimeConfig()
|
|
|
+const { apiBaseSiteUrl, apiBaseUrl } = config.public
|
|
|
+
|
|
|
const route = useRoute()
|
|
|
const detail = ref<any>({})
|
|
|
const tabValue = ref('blog')
|
|
@@ -23,7 +25,7 @@ const slug = route.params.slug
|
|
|
const { data, pending, error, refresh } = await useAsyncData(
|
|
|
'blog-detail',
|
|
|
() =>
|
|
|
- $fetch(`${process.env.MY_ENV_DEV_URL}${Api.BlogDetail}`, { params: { slug } }),
|
|
|
+ $fetch(`${apiBaseUrl}${Api.BlogDetail}`, { params: { slug } }),
|
|
|
)
|
|
|
const seoData = data.value?.result
|
|
|
// 把createTime和updateTime转换为ISO格式
|
|
@@ -56,7 +58,7 @@ useHead({
|
|
|
},
|
|
|
{
|
|
|
property: 'og:url',
|
|
|
- content: `${process.env.MY_ENV_DEV_URL}/blog/${slug}`,
|
|
|
+ content: `${apiBaseSiteUrl}/blog/${slug}`,
|
|
|
},
|
|
|
{
|
|
|
property: 'og:type',
|
|
@@ -72,7 +74,7 @@ useHead({
|
|
|
},
|
|
|
{
|
|
|
property: 'twitter:site',
|
|
|
- content: `${process.env.MY_ENV_DEV_URL}/blog/${slug}`,
|
|
|
+ content: `${apiBaseSiteUrl}/blog/${slug}`,
|
|
|
},
|
|
|
{
|
|
|
property: 'twitter:image',
|
|
@@ -96,7 +98,7 @@ useHead({
|
|
|
link: [
|
|
|
{
|
|
|
rel: 'canonical',
|
|
|
- href: `${process.env.MY_ENV_DEV_URL}/blog/${slug}`,
|
|
|
+ href: `${apiBaseSiteUrl}/blog/${slug}`,
|
|
|
},
|
|
|
],
|
|
|
})
|