如果账号已在其他地方登录,弹窗是否强制登录&全员观看-活跃用户
This commit is contained in:
parent
32d238fb7f
commit
67682defa8
52
src/App.tsx
52
src/App.tsx
|
|
@ -8,11 +8,11 @@ import Login from '@/page/Login/index'
|
|||
import Meeting from '@/page/Meeting/index'
|
||||
import NotFound from '@/page/NotFound/index'
|
||||
import { storage } from '@/utils'
|
||||
import { message, Spin } from "antd";
|
||||
import { message, Modal, Spin } from "antd";
|
||||
import JoinMeetingModal from "@/components/JoinMeetingModal";
|
||||
import UpdateModal from "@/components/UpdateModal";
|
||||
import * as CryptoJS from 'crypto-js';
|
||||
import { PostLogin } from "@/api/Login";
|
||||
import { GetCheckOnline, PostLogin } from "@/api/Login";
|
||||
import { agora } from "@/utils/package/agora";
|
||||
import QuitTips from "@/components/QuitTips";
|
||||
import { GetLeave } from "@/api/Meeting";
|
||||
|
|
@ -22,6 +22,8 @@ import ChatSmallWindow from "@/page/Meeting/ChatSmallWindow";
|
|||
import ChatBigWindow from "@/page/Meeting/ChatBigWindow";
|
||||
import NoticeWindow from "@/page/Meeting/NoticeWindow";
|
||||
import { getKeyOpenChildWindow, getTitle, setKeyOpenChildWindow, storageSeeting } from "./utils/package/public";
|
||||
import { ExclamationCircleFilled } from "@ant-design/icons";
|
||||
const { confirm } = Modal;
|
||||
const fs = require('fs').promises;
|
||||
const { exec } = require('child_process');
|
||||
const App: React.FC = () => {
|
||||
|
|
@ -41,20 +43,44 @@ const App: React.FC = () => {
|
|||
useEffect(() => {
|
||||
let userInfo = JSON.parse(storage.getItem('user') as string)
|
||||
let loginInfo = JSON.parse(storage.getItem('login') as string)
|
||||
const login = () => {
|
||||
PostLogin({
|
||||
account: loginInfo.account,
|
||||
pwd: CryptoJS.MD5(loginInfo.password).toString(CryptoJS.enc.Hex)
|
||||
}).then(async (res) => {
|
||||
if (res.code === 200) {
|
||||
storage.setItem('user', JSON.stringify(res.data))
|
||||
storage.setItem('userLogin', true)
|
||||
toSrc('/home')
|
||||
await window.electron.startSignalr(res.data)
|
||||
} else {
|
||||
toSrc('/login')
|
||||
}
|
||||
})
|
||||
}
|
||||
window.electron.setEnv(import.meta.env.VITE_ENV);
|
||||
if (userInfo && !userInfo.isAnonymous) {
|
||||
if (loginInfo && loginInfo.isAutoLogin) {
|
||||
PostLogin({
|
||||
account: loginInfo.account,
|
||||
pwd: CryptoJS.MD5(loginInfo.password).toString(CryptoJS.enc.Hex)
|
||||
}).then(async (res) => {
|
||||
if (res.code === 200) {
|
||||
storage.setItem('user', JSON.stringify(res.data))
|
||||
storage.setItem('userLogin', true)
|
||||
toSrc('/home')
|
||||
await window.electron.startSignalr(res.data)
|
||||
} else {
|
||||
toSrc('/login')
|
||||
GetCheckOnline(loginInfo.account).then(req => {
|
||||
if (req.code === 200) {
|
||||
if (req.data) {
|
||||
confirm({
|
||||
title: '提示',
|
||||
icon: <ExclamationCircleFilled />,
|
||||
content: `账号已在其他地方登录,是否强制登陆?`,
|
||||
centered: true,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
async onOk() {
|
||||
login()
|
||||
},
|
||||
onCancel() {
|
||||
|
||||
}
|
||||
})
|
||||
} else {
|
||||
login()
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -23,3 +23,9 @@ export const PostAnonLogin = (data: any) =>
|
|||
method: 'post',
|
||||
data,
|
||||
})
|
||||
|
||||
export const GetCheckOnline = (account: string) =>
|
||||
request({
|
||||
url: `/auth/check-online?account=${account}`,
|
||||
method: 'get'
|
||||
})
|
||||
|
|
@ -133,9 +133,11 @@ const StupWizard = forwardRef((_props: any, ref: any) => {
|
|||
})
|
||||
const CurrencyComponents = () => {
|
||||
const [optionsValue, setOperationValue] = useState<'hide' | 'quit'>('hide');
|
||||
const [voiceStimulation, setVoiceStimulation] = useState(true);
|
||||
const setting = JSON.parse(storage.getItem('setting') as string)
|
||||
useEffect(() => {
|
||||
setOperationValue(setting.closeSetting)
|
||||
setVoiceStimulation(setting.voiceStimulation)
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
|
|
@ -154,6 +156,33 @@ const CurrencyComponents = () => {
|
|||
<Radio value={'hide'}>不退出程序,最小化到托盘</Radio>
|
||||
</Radio.Group>
|
||||
</div>
|
||||
<div>
|
||||
<span>语音激励 <Popover
|
||||
content={
|
||||
<span
|
||||
style={{
|
||||
color: 'white'
|
||||
}}>
|
||||
开启语音激励后,会优先显示正在说话的与会成员。
|
||||
</span>
|
||||
}
|
||||
title=""
|
||||
>
|
||||
<QuestionCircleOutlined style={{
|
||||
color: 'white',
|
||||
cursor: 'pointer',
|
||||
marginRight: '10px'
|
||||
}} />
|
||||
</Popover></span>
|
||||
<Radio.Group onChange={(e: any) => {
|
||||
setting.voiceStimulation = e.target.value;
|
||||
storage.setItem('setting', JSON.stringify(setting))
|
||||
setVoiceStimulation(e.target.value)
|
||||
}} style={{ flexShrink: 0, margin: '10px 0' }} value={voiceStimulation}>
|
||||
<Radio value={true}>开启</Radio>
|
||||
<Radio value={false}>关闭</Radio>
|
||||
</Radio.Group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@ import { useEffect, useState } from "react";
|
|||
import { useNavigate } from 'react-router-dom';
|
||||
import { Input, Button, Checkbox, message, Modal } from "antd"
|
||||
import { storage } from '@/utils'
|
||||
import { GetCheckUser, PostAnonLogin, PostLogin } from '@/api/Login'
|
||||
import { GetCheckOnline, GetCheckUser, PostAnonLogin, PostLogin } from '@/api/Login'
|
||||
import * as CryptoJS from 'crypto-js';
|
||||
import ImageUrl from '@/utils/package/imageUrl'
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { GetCheckoutRoomNum, GetRoomInfo, GetRoomRtcToken } from '@/api/Home/Index';
|
||||
import { ExclamationCircleFilled } from '@ant-design/icons';
|
||||
const { confirm } = Modal;
|
||||
const Login: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
const [accountPasswordStatus, setAccountPasswordStatus] = useState<boolean>(false);
|
||||
|
|
@ -100,7 +102,32 @@ const Login: React.FC = () => {
|
|||
}
|
||||
GetCheckUser(operation.account).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data ? setAccountPasswordStatus(true) : message.error('账号不存在!')
|
||||
if (res.data) {
|
||||
GetCheckOnline(operation.account).then(req => {
|
||||
if (req.code === 200) {
|
||||
if (req.data) {
|
||||
confirm({
|
||||
title: '提示',
|
||||
icon: <ExclamationCircleFilled />,
|
||||
content: `账号已在其他地方登录,是否强制登陆?`,
|
||||
centered: true,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
async onOk() {
|
||||
setAccountPasswordStatus(true)
|
||||
},
|
||||
onCancel() {
|
||||
|
||||
}
|
||||
})
|
||||
} else {
|
||||
setAccountPasswordStatus(true)
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
message.error('账号不存在!')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,7 +200,10 @@ export const agora = {
|
|||
},
|
||||
// 监测到远端最活跃用户回调。
|
||||
onActiveSpeaker: (connection: RtcConnection, uid: number) => {
|
||||
onActiveSpeaker?.(connection, uid)
|
||||
const setting = JSON.parse(storage.getItem('setting') as string);
|
||||
if (setting.voiceStimulation) {
|
||||
onActiveSpeaker?.(connection, uid)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ export const storageSeeting: any = {
|
|||
shareFilesPath: path.resolve(__dirname, '../../Downloads/') + '\\', //共享文件保存路径
|
||||
isShareSavePath: true, //是否下载钱询问每个文件保存的位置
|
||||
closeSetting: 'hide', //关闭按钮设置
|
||||
voiceStimulation: true, //语音激励
|
||||
isAINoiseReduction: true, //是否开启ai降噪
|
||||
aINoiseReduction: 1, // 降噪模式
|
||||
isRecordingTips: true, //是否开启录制提示
|
||||
|
|
|
|||
Loading…
Reference in New Issue