Explorar o código

fix(student page): remove userid parameter from iframe hash

在学生页面的iframe链接处理中,移除hash部分里的userid参数,避免信息泄露或不必要的参数携带
lsc hai 3 días
pai
achega
526ee6a385
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/views/Student/index.vue

+ 4 - 0
src/views/Student/index.vue

@@ -1646,6 +1646,10 @@ const elementDone = async (element: any, slideIndex: number) => {
         const parts = iframeSrc.split('#')
         baseUrl = parts[0]
         hashPart = parts[1]
+        // 去除hashPart中的userid参数
+        if (hashPart.includes('userid=')) {
+          hashPart = hashPart.replace(/[?&]userid=[^&]+/g, '').replace(/^&/, '?')
+        }
       }
 
       // 构建新的hash部分,添加参数