fix: add stream close check, recover regression test assertions, and secure credentials type check
This commit is contained in:
@@ -1986,6 +1986,7 @@ async function triggerSyncUpstreamModels() {
|
||||
syncModelsDialog.value = true
|
||||
|
||||
let hasProcessedStart = false
|
||||
let gotComplete = false
|
||||
|
||||
try {
|
||||
const authStore = useAuthStore()
|
||||
@@ -2040,6 +2041,7 @@ async function triggerSyncUpstreamModels() {
|
||||
syncModelsResults.value.push(data)
|
||||
} else if (event === 'complete') {
|
||||
syncModelsMessage.value = data.message
|
||||
gotComplete = true
|
||||
if (data.success) {
|
||||
ElMessage.success('同步完成')
|
||||
} else {
|
||||
@@ -2061,6 +2063,7 @@ async function triggerSyncUpstreamModels() {
|
||||
syncModelsResults.value.push(data)
|
||||
} else if (event === 'complete') {
|
||||
syncModelsMessage.value = data.message
|
||||
gotComplete = true
|
||||
if (data.success) {
|
||||
ElMessage.success('同步完成')
|
||||
} else {
|
||||
@@ -2070,6 +2073,10 @@ async function triggerSyncUpstreamModels() {
|
||||
throw new Error(data.message || '流式同步出错')
|
||||
}
|
||||
}
|
||||
|
||||
if (!gotComplete) {
|
||||
throw new Error('同步流异常中断,未获取到完整执行报告')
|
||||
}
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e.message || '同步上游模型失败')
|
||||
if (!hasProcessedStart || syncModelsResults.value.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user