重新打开应用是否自动登录判断优化 #18

Merged
yangqiang merged 14 commits from yangjie into master 2024-10-11 14:15:18 +08:00
4 changed files with 131 additions and 121 deletions
Showing only changes of commit 4026b79deb - Show all commits

15
main.js
View File

@ -17,7 +17,7 @@ const { autoUpdater, CancellationToken } = require('electron-updater');
const cancellationToken = new CancellationToken()
app.allowRendererProcessReuse = false;
let mainWindow = null;
let childWindow = []
let childWindow = {}
let isMaximized = false;
let env;
let regKey;
@ -310,18 +310,17 @@ app.on('ready', () => {
enableRemoteModule: true,
nodeIntegrationInWorker: true,
allowMediaDevices: true,
// preload: path.join(__dirname, 'preload.js')
preload: path.join(__dirname, 'preload.js')
},
// show: false,
// frame: false,
// backgroundColor: '#00000000',
// transparent: true,
show: false,
frame: false,
backgroundColor: '#00000000',
transparent: true,
})
child.loadURL(config.url)
childWindow.push(child)
childWindow[key] = child
child.once('ready-to-show', () => {
child.show()
console.log(config);
child.setSize(config.width, config.height)
})
});

View File

@ -18,6 +18,7 @@ import { agora } from "@/utils/package/agora";
import QuitTips from "@/components/QuitTips";
import { GetLeave } from "@/api/Meeting";
import path from "path";
import ShareScreenWindow from "./page/ShareScreenWindow";
const fs = require('fs').promises;
const { exec } = require('child_process');
const App: React.FC = () => {
@ -32,6 +33,7 @@ const App: React.FC = () => {
});
const [spinning, setSpinning] = useState(false);
const [isState, setIsState] = useState(true);
if (location.hash.indexOf('shareScreenWindow') == -1) {
useEffect(() => {
let userInfo = JSON.parse(storage.getItem('user') as string)
let loginInfo = JSON.parse(storage.getItem('login') as string)
@ -148,6 +150,7 @@ const App: React.FC = () => {
onStop()
}
}, [navigate])
}
useEffect(() => {
document.addEventListener('keydown', (event) => {
if (event.key === 'F11') {
@ -239,6 +242,7 @@ const App: React.FC = () => {
</Route>
<Route path='/login' element={<Login />} />
<Route path='/meeting' element={<Meeting />} />
<Route path='/shareScreenWindow' element={<ShareScreenWindow />} />
<Route path='*' element={<NotFound />} />
</Routes>
<Spin spinning={spinning} fullscreen />

View File

@ -1,5 +1,7 @@
.shareScreenWindow {
background-color: red;
color: red;
color: black;
height: 100%;
width: 100%;
font-size: 30px;
}

View File

@ -6,7 +6,12 @@ const ShareScreenWindow: React.FC = () => {
}, []);
// window.electron.createChildWindow({
// url: location.origin + `/#/shareScreenWindow`,
// width: 600,
// height: 40,
// key: 'shareScreenWindow',
// })
return (
<>
<div className={styles.shareScreenWindow}>