feat: 摄像头验证码绑定检查 && 视觉分析URL动态获取

This commit is contained in:
rainv123
2026-02-03 11:52:22 +08:00
parent 005dc55db3
commit 85a83727fd
4 changed files with 64 additions and 21 deletions
+9 -1
View File
@@ -44,6 +44,8 @@ class App {
initMcpTools();
// 检查麦克风可用性
await this.checkMicrophoneAvailability();
// 检查摄像头可用性
this.checkCameraAvailability();
// 初始化Live2D
await this.initLive2D();
// 初始化摄像头
@@ -115,6 +117,12 @@ class App {
}
}
// 检查摄像头可用性
checkCameraAvailability() {
window.cameraAvailable = true;
log('摄像头可用性检查完成: 默认已绑定验证码', 'success');
}
// 初始化摄像头
async initCamera() {
const cameraContainer = document.getElementById('cameraContainer');
@@ -232,7 +240,7 @@ class App {
log(`拍照成功,图像数据长度: ${photoData.length}`, 'success');
try {
const visionApiUrl = 'http://localhost:8003/mcp/vision/explain';
const visionApiUrl = window.visionApiUrl || 'http://localhost:8003/mcp/vision/explain';
log(`正在发送图片到视觉分析接口: ${visionApiUrl}`, 'info');
const deviceId = document.getElementById('deviceMac')?.value || '';