Compare commits
2 Commits
7b61a073bd
...
3cfbd0da62
| Author | SHA1 | Date |
|---|---|---|
|
|
3cfbd0da62 | |
|
|
2704511e75 |
2
main.js
2
main.js
|
|
@ -138,7 +138,7 @@ app.on('ready', () => {
|
|||
// 获取当前脚本所在目录的绝对路径
|
||||
const currentDirectory = __dirname;
|
||||
// 获取安装父目录
|
||||
const parentDirectory = path.resolve(currentDirectory, '../..');
|
||||
const parentDirectory = path.resolve(currentDirectory, '..');
|
||||
const customFolderPath = path.join(parentDirectory, 'Downloads');
|
||||
if (!fs.existsSync(customFolderPath)) {
|
||||
// 如果不存在,则创建文件夹
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import styles from '@/components/StupWizard/index.module.scss'
|
||||
import ImageUrl from '@/utils/package/ImageUrl';
|
||||
import { Button, Checkbox, Empty, Input, Modal, Popover, Radio, Select, Slider, message } from 'antd';
|
||||
import { useState, useImperativeHandle, forwardRef, useEffect } from "react";
|
||||
import {Button, Checkbox, Empty, Input, message, Modal, Popover, Radio, Select, Slider} from 'antd';
|
||||
import {forwardRef, useEffect, useImperativeHandle, useState} from "react";
|
||||
import agora from '@/utils/package/agora'
|
||||
import {CloseOutlined, LoadingOutlined, QuestionCircleOutlined} from '@ant-design/icons';
|
||||
import {storage} from '@/utils';
|
||||
import path from 'path';
|
||||
|
||||
const fs = require('fs').promises;
|
||||
const {exec} = require('child_process');
|
||||
const StupWizard = forwardRef((props: any, ref: any) => {
|
||||
|
|
@ -256,7 +257,13 @@ const AudioComponents = () => {
|
|||
})
|
||||
}, []);
|
||||
const getAudioMediaList = async (): Promise<void> => {
|
||||
const { playBackList, ecordingList, playBackItem, ecordingItem, ecordingVolume } = await agora.getAudioMediaList();
|
||||
const {
|
||||
playBackList,
|
||||
ecordingList,
|
||||
playBackItem,
|
||||
ecordingItem,
|
||||
ecordingVolume
|
||||
} = await agora.getAudioMediaList();
|
||||
if ((!setting.ecordingDeviceId && ecordingItem.deviceId) || (!(ecordingList.find((item: any) => item.deviceId === setting.ecordingDeviceId)) && ecordingItem.deviceId)) {
|
||||
setting.ecordingDeviceId = ecordingItem.deviceId
|
||||
}
|
||||
|
|
@ -345,7 +352,8 @@ const AudioComponents = () => {
|
|||
</div> : null}
|
||||
<div className={styles.audioComponentsSlider}>
|
||||
<span>输入音量:</span>
|
||||
<Slider value={audioDeviceManager.ecordingVolume} style={{ flexGrow: 1 }} max={255} onChange={async (e) => {
|
||||
<Slider value={audioDeviceManager.ecordingVolume} style={{flexGrow: 1}} max={255}
|
||||
onChange={async (e) => {
|
||||
setting.ecordingVolume = e;
|
||||
storage.setItem('setting', JSON.stringify(setting))
|
||||
await agora.setRecordingDeviceVolume(e)
|
||||
|
|
@ -409,7 +417,8 @@ const AudioComponents = () => {
|
|||
</div> : null}
|
||||
<div className={styles.audioComponentsSlider}>
|
||||
<span>输出音量:</span>
|
||||
<Slider value={audioDeviceManager.playBackVolume} style={{ flexGrow: 1 }} max={255} onChange={async (e) => {
|
||||
<Slider value={audioDeviceManager.playBackVolume} style={{flexGrow: 1}} max={255}
|
||||
onChange={async (e) => {
|
||||
setting.playBackVolume = e;
|
||||
storage.setItem('setting', JSON.stringify(setting))
|
||||
agora.setPlaybackDeviceVolume(e)
|
||||
|
|
@ -430,7 +439,10 @@ const RecordingComponents = () => {
|
|||
const setting = JSON.parse(storage.getItem('setting') as string)
|
||||
useEffect(() => {
|
||||
if (!setting.recordingFilesPath) {
|
||||
setting.recordingFilesPath = path.dirname(process.execPath) + '\\';
|
||||
// 获取安装父目录
|
||||
const currentDirectory = __dirname;
|
||||
const parentDirectory = path.resolve(currentDirectory, '../../Downloads');
|
||||
setting.recordingFilesPath = parentDirectory;
|
||||
setFilePath(setting.recordingFilesPath)
|
||||
storage.setItem('setting', JSON.stringify(setting))
|
||||
} else {
|
||||
|
|
@ -498,7 +510,10 @@ const FileComponents = () => {
|
|||
const setting = JSON.parse(storage.getItem('setting') as string)
|
||||
useEffect(() => {
|
||||
if (!setting.shareFilesPath) {
|
||||
setting.shareFilesPath = path.dirname(process.execPath) + '\\';
|
||||
// 获取安装父目录
|
||||
const currentDirectory = __dirname;
|
||||
const parentDirectory = path.resolve(currentDirectory, '../../Downloads');
|
||||
setting.shareFilesPath = parentDirectory
|
||||
setFilePath(setting.shareFilesPath)
|
||||
storage.setItem('setting', JSON.stringify(setting))
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue