feat(wechat): 关注公众号后自动回复欢迎语(被动回复,可后台配置) #12

Merged
Blizzard merged 42 commits from feat/site into main 2026-07-22 07:24:18 +00:00
3 changed files with 9 additions and 0 deletions
Showing only changes of commit 92341be32c - Show all commits
@@ -27,6 +27,8 @@
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>NSMicrophoneUsageDescription</key>
<string>JARVIS 语音助手需要麦克风来听你说话。</string>
<key>NSHighResolutionCapable</key>
<string>true</string>
<key>NSHumanReadableCopyright</key>
+2
View File
@@ -22,6 +22,8 @@
<string>0.1.1</string>
<key>LSMinimumSystemVersion</key>
<string>12.0.0</string>
<key>NSMicrophoneUsageDescription</key>
<string>JARVIS 语音助手需要麦克风来听你说话。</string>
<key>NSHighResolutionCapable</key>
<string>true</string>
<key>NSHumanReadableCopyright</key>
@@ -196,6 +196,11 @@ export class VoiceClient {
private async startMic(): Promise<void> {
if (this.micNode) return;
// WKWebViewWails 原生壳)等非安全上下文里 navigator.mediaDevices 可能未暴露——
// 直接调用会抛 "undefined is not an object" 崩掉。先探测,给出可读提示而非崩溃。
if (!navigator.mediaDevices?.getUserMedia) {
throw new Error("此窗口暂不支持麦克风(原生壳需授权/安全上下文)。用浏览器打开 localhost:5173 可直接说话。");
}
const stream = await navigator.mediaDevices.getUserMedia({
audio: { channelCount: 1, echoCancellation: true, noiseSuppression: true },
});