Commit 1e2b5f3221be6315650055895f1f63cd87d99ac8

Authored by boyang
1 parent bea0a5fe

fix: 修复分享链接bug,prod2.sh-27-28

components/MobileProductDetail.vue
... ... @@ -311,10 +311,7 @@ const href1 = ref("/products");
311 311 const href2 = ref("/products");
312 312 const routeQuery = useRouteQuery();
313 313 const productStore = useProductListStore();
314   -const currentUrl = ref();
315   -onMounted(() => {
316   - currentUrl.value = window.location.href;
317   -});
  314 +const currentUrl = ref("https://www.canrud.com/products");
318 315 // const ticketDiv = ref<HTMLDivElement | null>(null); // 引用 ticketDiv
319 316 // const bottomButton = ref<HTMLDivElement | null>(null); // 引用按钮元素
320 317 // let isMonitoring = false; // 是否正在监控 ticketDiv
... ... @@ -426,6 +423,7 @@ const items = ref&lt;BreadcrumbItem[]&gt;([
426 423 },
427 424 ]);
428 425 watchEffect(() => {
  426 + currentUrl.value = "https://www.canrud.com/products/detail/" + info.id;
429 427 if (info?.productCrumbsVO?.category1 && productStore.keyword) {
430 428 items.value[1].title = info.productCrumbsVO.category1;
431 429 items.value[1].href =
... ...
components/ProductDetail.vue
... ... @@ -422,16 +422,13 @@ const href1 = ref(&quot;/products&quot;);
422 422 const href2 = ref("/products");
423 423 const idHref = ref("/products");
424 424 const productStore = useProductListStore();
425   -const currentUrl = ref();
  425 +const currentUrl = ref("https://www.canrud.com/products");
426 426 // 定义单个 item 的接口
427 427 interface BreadcrumbItem {
428 428 title: string; // 标题
429 429 disabled: boolean; // 是否禁用
430 430 href: string; // 链接地址
431 431 }
432   -onMounted(() => {
433   - currentUrl.value = window.location.href;
434   -});
435 432 // 示例数据
436 433 const items = ref<BreadcrumbItem[]>([
437 434 {
... ... @@ -476,6 +473,7 @@ let { data: resData } = await useAsyncData(
476 473 }
477 474 );
478 475 watchEffect(() => {
  476 + currentUrl.value = "https://www.canrud.com/products/detail/" + info.id;
479 477 if (info?.productCrumbsVO?.category1 && productStore.keyword) {
480 478 items.value[1].title = info.productCrumbsVO.category1;
481 479 items.value[1].href =
... ...
deploy/prod2.sh
1 1 #!/bin/bash
2 2 # 变量定义
3   -LAST_TAG="1.0.26"
4   -TAG="1.0.27"
  3 +LAST_TAG="1.0.27"
  4 +TAG="1.0.28"
5 5 TARGET_PATH="/root/web/canrud-outside-nuxt-front"
6 6 DOCKERFILE_PATH="/root/web/canrud-outside-nuxt-front/canrud-nuxt-front"
7 7 IMAGE_NAME="canrud-outside-front"
... ...