Procházet zdrojové kódy

修改接收传参

11wqe1 před 6 dny
rodič
revize
6cb0f46818
1 změnil soubory, kde provedl 17 přidání a 4 odebrání
  1. 17 4
      src/views/HomeView.vue

+ 17 - 4
src/views/HomeView.vue

@@ -799,12 +799,24 @@ export default {
 			this.$refs.homepageLRef.getadmincocoFlow();
 			this.loading = false;
 		},
+		getUrlParam(urlStr, urlKey) {
+			const url = new URL(urlStr) // 字符串转换成url格式
+			const paramsStr = url.search.slice(1) // 获取'?'后面的参数字符串
+			const paramsArr = paramsStr.split('&') // 分割'&'字符 获得参数数组
+			for (let i = 0; i < paramsArr.length; i++) {
+				const tempArr = paramsArr[i].split('=')
+				if (tempArr[0] === urlKey) {
+					return tempArr[1]
+				}
+			}
+		}
+
 	},
 	mounted() {
 		console.log("重新获取数据");
-		console.log('this.$route.query.courseId',this.$route.query.courseId);
-		console.log('this.$route.query.cocoNoteType',this.$route.query.cocoNoteType);
-
+		console.log('this.$route.query.courseId',this.$route.query.courseid);
+		let pagetype = this.getUrlParam(window.parent.location.href, 'type');
+		console.log('pagetype',pagetype);
 		
 		if (
 			!this.roleUser.cclassid &&
@@ -817,7 +829,8 @@ export default {
 		}
 		// this.getMsg()
 		// 跨学科app跳转 
-		if(this.cocoNoteType == 'coconote'){
+
+		if(pagetype === 'coconote'){
 			this.cocoNoteif()
 			return
 		}else if (this.courseId) {