2
0
فهرست منبع

♻️ refactor(classroom): 移除joinClass函数中未使用的URL参数处理代码

- 删除注释掉的URL参数获取和处理逻辑
- 移除未使用的pathClassId和pathRole相关代码
- 清理课堂ID验证的冗余注释代码块
yourname 6 ماه پیش
والد
کامیت
c57fecd89a
1فایلهای تغییر یافته به همراه0 افزوده شده و 13 حذف شده
  1. 0 13
      src/client/mobile/components/Classroom/useClassroom.ts

+ 0 - 13
src/client/mobile/components/Classroom/useClassroom.ts

@@ -534,19 +534,6 @@ export const useClassroom = ({ user }:{ user : User }) => {
 
 
   const joinClass = async (classId: string): Promise<void> => {
   const joinClass = async (classId: string): Promise<void> => {
     if (!imEngine.current || !aliRtcEngine.current) return;
     if (!imEngine.current || !aliRtcEngine.current) return;
-    
-    // // 优先使用URL参数中的classId和role
-    // const { id: pathClassId, role: pathRole } = useParams();
-    // const finalClassId = (classId || pathClassId) as string;
-    // if (pathRole && ['teacher', 'student'].includes(pathRole)) {
-    //   setRole(pathRole === 'teacher' ? Role.Teacher : Role.Student);
-    // }
-    
-    // if (!finalClassId) {
-    //   setErrorMessage('课堂ID不能为空');
-    //   showToast('error', '请输入有效的课堂ID');
-    //   return;
-    // }
 
 
     try {
     try {
       const gm = imEngine.current.getGroupManager();
       const gm = imEngine.current.getGroupManager();