|
@@ -68,7 +68,8 @@ interface Question {
|
|
|
export enum ClassStatus {
|
|
export enum ClassStatus {
|
|
|
NOT_STARTED = 'not_started',
|
|
NOT_STARTED = 'not_started',
|
|
|
IN_PROGRESS = 'in_progress',
|
|
IN_PROGRESS = 'in_progress',
|
|
|
- ENDED = 'ended'
|
|
|
|
|
|
|
+ ENDED = 'ended',
|
|
|
|
|
+ PRIVATE_ACCESS_DENIED = 'private_access_denied'
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -653,10 +654,11 @@ export const useClassroom = ({ user }:{ user : User }) => {
|
|
|
console.error('获取群组信息失败:', err);
|
|
console.error('获取群组信息失败:', err);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 如果没有权限,抛出错误统一处理
|
|
|
|
|
|
|
+ // 如果没有权限,设置课堂状态为权限不足
|
|
|
if (!hasPermission) {
|
|
if (!hasPermission) {
|
|
|
console.log('该课堂为闭门会议,只有老师和学员身份可以进入')
|
|
console.log('该课堂为闭门会议,只有老师和学员身份可以进入')
|
|
|
- throw new Error('该课堂为闭门会议,只有老师和学员身份可以进入');
|
|
|
|
|
|
|
+ setClassStatus(ClassStatus.PRIVATE_ACCESS_DENIED);
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
listenGroupEvents();
|
|
listenGroupEvents();
|