From 629b16ca8a7b41c21a76e976ab9b6308d45de594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E6=B0=91=E5=BA=B7?= Date: Fri, 28 Mar 2025 14:47:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=AF=E5=90=A6=E8=AE=A2=E9=98=85=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jyh/index.ts | 10 ++++++++++ src/views/Jyh/Version/Detail/index.vue | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/api/jyh/index.ts b/src/api/jyh/index.ts index c96a56c..c533bf5 100644 --- a/src/api/jyh/index.ts +++ b/src/api/jyh/index.ts @@ -286,3 +286,13 @@ export const getLicenseDetail = ({ id }): Promise => { }) ); }; +// 是否订阅 +export const alertIsSubscribe = (data): Promise => { + return reqCatchV2(() => + request({ + url: `/api/v1/alert/isSubscribe`, + method: 'POST', + data, + }) + ); +}; diff --git a/src/views/Jyh/Version/Detail/index.vue b/src/views/Jyh/Version/Detail/index.vue index b27aef7..abaac2d 100644 --- a/src/views/Jyh/Version/Detail/index.vue +++ b/src/views/Jyh/Version/Detail/index.vue @@ -72,7 +72,7 @@ const { namespace } = getOrgInfo(); const route = useRoute(); // 获取路由对象 const avatarUrl = '/src/assets/imgs/jyh/工程首字母图标.png'; import SubscriptionModal from '@/views/Jyh/Version/Detail/SubscriptionModal.vue'; -import { releaseInfo } from '@/api/jyh'; +import { alertIsSubscribe, releaseInfo } from '@/api/jyh'; const selectTab = ref('bbxx'); const softwareId = ref(); @@ -99,11 +99,19 @@ const getReleaseInfo = async(versionId) => { } }; +const getAlertIsSubscribe = async(versionId) => { + const { data, error } = await alertIsSubscribe({ softwareId: versionId }); + if (!error && data) { + isSub.value = data.data; + } +}; + onMounted(() => { const versionId = route.params.versionId; // 获取路由参数 versionId softwareId.value = versionId; if (versionId) { getReleaseInfo(versionId); // 调用接口获取数据 + getAlertIsSubscribe(versionId); // 调用接口获取数据 } });