From f3c53678c9500b38788b7fe2a9a67bdff6a53d49 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 29 Oct 2024 11:30:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 41 ++------------------------- src/components/StupWizard/index.tsx | 43 ++--------------------------- src/utils/package/public.ts | 41 +++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 79 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 28dffac..5e0b4ef 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,7 +23,7 @@ import ChatSmallWindow from "@/page/Meeting/ChatSmallWindow"; import ChatBigWindow from "@/page/Meeting/ChatBigWindow"; import CurrentSpeakUserWindow from "@/page/Meeting/CurrentSpeakUserWindow"; import NoticeWindow from "@/page/Meeting/NoticeWindow"; -import { getKeyOpenChildWindow, setKeyOpenChildWindow } from "./utils/package/public"; +import { getKeyOpenChildWindow, setKeyOpenChildWindow, storageSeeting } from "./utils/package/public"; const fs = require('fs').promises; const { exec } = require('child_process'); const App: React.FC = () => { @@ -133,44 +133,7 @@ const App: React.FC = () => { } }) if (!storage.getItem('setting')) { - storage.setItem('setting', JSON.stringify({ - videoDeviceId: '', //摄像头id - ecordingDeviceId: "", //输入设备id - playBackDeviceId: "", //输出设备id - ecordingVolume: '', //输入音量 - playBackVolume: '', //输出音量 - autoEcordingVolume: true, //是否自动调整麦克风音量 - recordingFilesPath: path.resolve(__dirname, '../../Downloads') + '\\', //本地录制保存路径 - shareFilesPath: path.resolve(__dirname, '../../Downloads/') + '\\', //共享文件保存路径 - isShareSavePath: true, //是否下载钱询问每个文件保存的位置 - closeSetting: 'hide', //关闭按钮设置 - isAINoiseReduction: true, //是否开启ai降噪 - aINoiseReduction: 1, // 降噪模式 - isRecordingTips: true, //是否开启录制提示 - beautyEffect: { //美颜效果 - isBeautyEffect: false, //是否打开美颜 - lighteningContrastLevel: 1, //对比度 - lighteningLevel: 0, //美白程度 - smoothnessLevel: 0, //磨皮程度 - rednessLevel: 0, //红润度 - sharpnessLevel: 0, //锐化程度 - }, - colorEnhancement: { //色彩增强 - isColorEnhancement: false, //是否打开色彩增强 - strengthLevel: 0.5, //色彩增强程度 - skinProtectLevel: 1, //肤色保护程度 - }, - darkLightEnhancement: { //暗光增强 - isDarkLightEnhancement: false, //是否打开暗光增强 - level: 0, //暗光增强等级 - mode: 0, //暗光增强模式 - }, - virtualBackground: { //虚拟背景 - isVirtualBackground: false, //是否打开虚拟背景 - color: '0xFFFFFF', // 纯色 - sourceIndex: '', // 背景图下标 - }, - })) + storage.setItem('setting', JSON.stringify(storageSeeting)) } if (!storage.getItem('openChildWindow')) { storage.setItem('openChildWindow', JSON.stringify({})) diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index d100105..030bdaf 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -7,6 +7,7 @@ import { CloseOutlined, LoadingOutlined, QuestionCircleOutlined } from '@ant-des import { storage } from '@/utils'; import path from 'path'; import { role } from '@/config/role'; +import { storageSeeting } from '@/utils/package/public'; let meetingUserInfo = '' as any; const fs = require('fs').promises; const { exec } = require('child_process'); @@ -25,47 +26,9 @@ const StupWizard = forwardRef((_props: any, ref: any) => { return res }) const setting = JSON.parse(storage.getItem('setting') as string) - const obj: any = { - videoDeviceId: '', //摄像头id - ecordingDeviceId: "", //输入设备id - playBackDeviceId: "", //输出设备id - ecordingVolume: '', //输入音量 - playBackVolume: '', //输出音量 - autoEcordingVolume: true, //是否自动调整麦克风音量 - recordingFilesPath: path.resolve(__dirname, '../../Downloads') + '\\', //本地录制保存路径 - shareFilesPath: path.resolve(__dirname, '../../Downloads/') + '\\', //共享文件保存路径 - isShareSavePath: true, //是否下载钱询问每个文件保存的位置 - closeSetting: 'hide', //关闭按钮设置 - isAINoiseReduction: true, //是否开启ai降噪 - aINoiseReduction: 1, // 降噪模式 - isRecordingTips: true, //是否开启录制提示 - beautyEffect: { //美颜效果 - isBeautyEffect: false, //是否打开美颜 - lighteningContrastLevel: 1, //对比度 - lighteningLevel: 0, //美白程度 - smoothnessLevel: 0, //磨皮程度 - rednessLevel: 0, //红润度 - sharpnessLevel: 0, //锐化程度 - }, - colorEnhancement: { //色彩增强 - isColorEnhancement: false, //是否打开色彩增强 - strengthLevel: 0.5, //色彩增强程度 - skinProtectLevel: 1, //肤色保护程度 - }, - darkLightEnhancement: { //暗光增强 - isDarkLightEnhancement: false, //是否打开暗光增强 - level: 0, //暗光增强等级 - mode: 0, //暗光增强模式 - }, - virtualBackground: { //虚拟背景 - isVirtualBackground: false, //是否打开虚拟背景 - color: '0xFFFFFF', // 纯色 - sourceIndex: '', // 背景图下标 - }, - } - for (const key in obj) { + for (const key in storageSeeting) { if (setting[key] === undefined) { - setting[key] = obj[key] + setting[key] = storageSeeting[key] } } storage.setItem('setting', JSON.stringify(setting)) diff --git a/src/utils/package/public.ts b/src/utils/package/public.ts index 6a22ec2..82f5aba 100644 --- a/src/utils/package/public.ts +++ b/src/utils/package/public.ts @@ -1,3 +1,4 @@ +import path from "path"; import storage from "./storage"; export const setKeyOpenChildWindow = async (key: string, bool: boolean) => { const openChildWindow = await JSON.parse(storage.getItem('openChildWindow') as string) @@ -13,3 +14,43 @@ export const getKeyOpenChildWindow = async (key: string): Promise => { const openChildWindow = await JSON.parse(storage.getItem('openChildWindow') as string) return openChildWindow[key] }; + + +export const storageSeeting: any = { + videoDeviceId: '', //摄像头id + ecordingDeviceId: "", //输入设备id + playBackDeviceId: "", //输出设备id + ecordingVolume: '', //输入音量 + playBackVolume: '', //输出音量 + autoEcordingVolume: true, //是否自动调整麦克风音量 + recordingFilesPath: path.resolve(__dirname, '../../Downloads') + '\\', //本地录制保存路径 + shareFilesPath: path.resolve(__dirname, '../../Downloads/') + '\\', //共享文件保存路径 + isShareSavePath: true, //是否下载钱询问每个文件保存的位置 + closeSetting: 'hide', //关闭按钮设置 + isAINoiseReduction: true, //是否开启ai降噪 + aINoiseReduction: 1, // 降噪模式 + isRecordingTips: true, //是否开启录制提示 + beautyEffect: { //美颜效果 + isBeautyEffect: false, //是否打开美颜 + lighteningContrastLevel: 1, //对比度 + lighteningLevel: 0, //美白程度 + smoothnessLevel: 0, //磨皮程度 + rednessLevel: 0, //红润度 + sharpnessLevel: 0, //锐化程度 + }, + colorEnhancement: { //色彩增强 + isColorEnhancement: false, //是否打开色彩增强 + strengthLevel: 0.5, //色彩增强程度 + skinProtectLevel: 1, //肤色保护程度 + }, + darkLightEnhancement: { //暗光增强 + isDarkLightEnhancement: false, //是否打开暗光增强 + level: 0, //暗光增强等级 + mode: 0, //暗光增强模式 + }, + virtualBackground: { //虚拟背景 + isVirtualBackground: false, //是否打开虚拟背景 + color: '0xFFFFFF', // 纯色 + sourceIndex: '', // 背景图下标 + }, +} \ No newline at end of file