fix(aihr): label case list demo fallback
This commit is contained in:
@@ -14,6 +14,15 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<el-alert
|
||||
v-if="recordsFallback"
|
||||
class="demo-data-alert"
|
||||
title="案例列表接口暂不可用,当前显示演示记录,不代表真实案例库数据"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
|
||||
<section class="case-grid">
|
||||
<article class="panel upload-panel">
|
||||
<div class="panel-title">
|
||||
@@ -180,6 +189,7 @@ const apiTags = ref<CaseTag[]>([]);
|
||||
const apiRecord = ref<CaseRecord | null>(null);
|
||||
const apiSampleHint = ref('');
|
||||
const recordsLoading = ref(false);
|
||||
const recordsFallback = ref(false);
|
||||
const detailVisible = ref(false);
|
||||
const caseDetail = ref<CaseDetailResponse | null>(null);
|
||||
const projectExtOrgId = ref('');
|
||||
@@ -276,8 +286,10 @@ async function loadCaseRecords() {
|
||||
try {
|
||||
const { data } = await getCaseRecords();
|
||||
records.value = data ?? [];
|
||||
recordsFallback.value = false;
|
||||
} catch {
|
||||
records.value = [...baseRecords];
|
||||
recordsFallback.value = true;
|
||||
ElMessage.warning('案例列表接口暂不可用,当前展示演示记录');
|
||||
} finally {
|
||||
recordsLoading.value = false;
|
||||
|
||||
Reference in New Issue
Block a user