generated from tailored/router-db-template
更新 package.json 和 pnpm-lock.yaml,修改版本号并添加依赖;重构 ASR 模块,优化音频处理逻辑,新增 AliyunAucChat 类及测试用例
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const isBrowser = (typeof process === 'undefined') ||
|
||||
(typeof window !== 'undefined' && typeof window.document !== 'undefined') ||
|
||||
const isBrowser = (typeof process === 'undefined') ||
|
||||
(typeof window !== 'undefined' && typeof window.document !== 'undefined') ||
|
||||
(typeof process !== 'undefined' && process?.env?.BROWSER === 'true');
|
||||
const chantHttpToWs = (url: string) => {
|
||||
if (url.startsWith('http://')) {
|
||||
@@ -24,7 +24,8 @@ export const initWs = async (url: string, options?: WebSocketOptions) => {
|
||||
if (isBrowser) {
|
||||
ws = new WebSocket(url);
|
||||
} else {
|
||||
const WebSocket = await import('ws').then((module) => module.default);
|
||||
const wsPakcages = 'ws' // 避免vite 自动会默认的在浏览器引入ws然后报错
|
||||
const WebSocket = await import(wsPakcages).then((module) => module.default);
|
||||
const { rejectUnauthorized, headers, ...rest } = options || {};
|
||||
ws = new WebSocket(url, {
|
||||
rejectUnauthorized: rejectUnauthorized ?? true,
|
||||
|
||||
Reference in New Issue
Block a user