From abfad93e599959e397fe51c2550d917761b10868 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 13 Nov 2024 17:32:26 +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/components/SingIn/index.tsx | 4 +++- src/page/Meeting/index.tsx | 27 +++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/components/SingIn/index.tsx b/src/components/SingIn/index.tsx index d37dbf7..58d64e9 100644 --- a/src/components/SingIn/index.tsx +++ b/src/components/SingIn/index.tsx @@ -6,7 +6,6 @@ import { useState, useImperativeHandle, forwardRef } from "react"; const SingIn = forwardRef((props: any, ref: any) => { useImperativeHandle(ref, () => ({ changeModal: () => { - setSingInModal(true) getRoomSingnIn() }, getModal: () => { @@ -23,6 +22,9 @@ const SingIn = forwardRef((props: any, ref: any) => { const getRoomSingnIn = async (): Promise => { await GetRoomSingnIn().then(res => { if (res.code === 200) { + if (res.data.length) { + setSingInModal(true) + } setSingInList(res.data.map((item: any) => { return { ...item, diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 25d4e1b..67ef2e8 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -418,6 +418,15 @@ const Meeting: React.FC = () => { firstFooterList[0][1].title = state.enableCamera ? '关闭视频' : '开启视频' firstFooterList[0][1].active = !state.enableCamera setFooterList(firstFooterList) + function showSingIn() { + if (!role.ID.includes(userInfo.roleId)) { + singInRef.current.getModal().then((res: boolean) => { + if (!res) { + singInRef.current.changeModal() + } + }) + } + } setTimeout(async () => { const setting = await JSON.parse(storage.getItem('setting') as string); const stateInfo = await JSON.parse(storage.getItem('stateInfo') as string); @@ -441,22 +450,10 @@ const Meeting: React.FC = () => { } else { message.error('当前不在会议室!') } - if (!role.ID.includes(userInfo.roleId)) { - singInRef.current.getModal().then((res: boolean) => { - if (!res) { - singInRef.current.changeModal() - } - }) - } + showSingIn() }, onCancel() { - if (!role.ID.includes(userInfo.roleId)) { - singInRef.current.getModal().then((res: boolean) => { - if (!res) { - singInRef.current.changeModal() - } - }) - } + showSingIn() } }) } @@ -465,6 +462,8 @@ const Meeting: React.FC = () => { } return data }) + } else { + showSingIn() } }, 10000); return () => {