瀏覽代碼

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

在学生页面的iframe链接处理中,移除hash部分里的userid参数,避免信息泄露或不必要的参数携带
lsc 3 月之前
父節點
當前提交
526ee6a385
共有 1 個文件被更改,包括 4 次插入 和 0 次删除
  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部分,添加参数