* 测试图片服务商连接(弹窗中)
()
| 474 | * 测试图片服务商连接(弹窗中) |
| 475 | */ |
| 476 | async function testImageConnection() { |
| 477 | testingImage.value = true |
| 478 | try { |
| 479 | const result = await testConnection({ |
| 480 | type: imageForm.value.type, |
| 481 | provider_name: editingImageProvider.value || undefined, |
| 482 | api_key: imageForm.value.api_key || undefined, |
| 483 | base_url: imageForm.value.base_url, |
| 484 | endpoint_type: imageForm.value.endpoint_type, |
| 485 | model: imageForm.value.model |
| 486 | }) |
| 487 | if (result.success) { |
| 488 | setSuccess(result.message || '连接成功') |
| 489 | } |
| 490 | } catch (e: any) { |
| 491 | setError(e, '连接失败') |
| 492 | } finally { |
| 493 | testingImage.value = false |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | /** |
| 498 | * 测试列表中的图片服务商 |
nothing calls this directly
no test coverage detected