diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index 91ede85..58b8c91 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -5,7 +5,7 @@ import { useState, useImperativeHandle, forwardRef, useEffect } from "react"; import agora from '@/utils/package/agora' import { CloseOutlined, LoadingOutlined } from '@ant-design/icons'; import { storage } from '@/utils'; -const os = require('os') +import path from 'path'; const fs = require('fs').promises; const { exec } = require('child_process'); const StupWizard = forwardRef((props: any, ref: any) => { @@ -379,7 +379,7 @@ const RecordingComponents = () => { useEffect(() => { const setting = JSON.parse(storage.getItem('setting') as string) if (!setting.recordingFilesPath) { - setting.recordingFilesPath = `${os.homedir()}\\Desktop\\` + setting.recordingFilesPath = path.dirname(process.execPath) + '\\'; setFilePath(setting.recordingFilesPath) storage.setItem('setting', JSON.stringify(setting)) } else { @@ -448,7 +448,7 @@ const FileComponents = () => { useEffect(() => { const setting = JSON.parse(storage.getItem('setting') as string) if (!setting.shareFilesPath) { - setting.shareFilesPath = `${os.homedir()}\\Desktop\\` + setting.shareFilesPath = path.dirname(process.execPath) + '\\'; setFilePath(setting.shareFilesPath) storage.setItem('setting', JSON.stringify(setting)) } else {