fix: some
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 2m16s

This commit is contained in:
luo
2026-10-14 09:12:34 +08:00
parent 697ff9c33c
commit d672dec0d0
10 changed files with 77 additions and 32 deletions

View File

@@ -108,7 +108,7 @@
</template>
<script setup>
import { ref, reactive, computed, onMounted } from 'vue';
import { ref, reactive, computed, onMounted, onUnmounted } from 'vue';
import { popupApi, notificationApi } from '@/api/index.js';
import { handledPopupNotificationIds } from '@/utils/popup.js';
import {
@@ -333,6 +333,8 @@
emit('close', 'done');
};
let mounted = true;
onUnmounted(() => { mounted = false; });
onMounted(async () => {
if (!props.identifier) {
emit('close', 'empty');
@@ -341,6 +343,7 @@
try {
const data = await popupApi.getCandidate(props.page, props.identifier);
if (!mounted) return;
const item = (data && data.candidate) || null;
if (!item || !item.notification_id || handledPopupNotificationIds.has(item.notification_id)) {
emit('close', 'empty');
@@ -353,6 +356,7 @@
resetForm();
visible.value = true;
} catch (e) {
if (!mounted) return;
// 资源不可见(400/code=1180)与接口异常统一静默关闭,不做 UI 分支
console.error('查询弹窗候选失败', e);
emit('close', 'invisible');