浏览代码

1

Signed-off-by: lcw <1324309909@qq.com>
lcw 3 年之前
父节点
当前提交
2899f89261

+ 20 - 19
src/App.vue

@@ -1,17 +1,17 @@
 <template>
 	<div id="app">
-		<div class="app_head" :class="{ stuWidth: $route.path == '/student' }">
+		<!-- <div class="app_head" :class="{ stuWidth: $route.path == '/student' }">
 			<div class="logo" @click="goTo('/')"></div>
 			<div class="app_right">
-				<div class="box_right_three" v-if="this.$store.state.isLogin">
+				<div class="box_right_three">
 					<div class="pic_img"><img src="./assets/myProject.png" alt="" /></div>
 					<div @click="goTo('/project')">我的课程</div>
 				</div>
-				<div class="box_right_three" v-if="this.$store.state.isLogin">
+				<div class="box_right_three">
 					<div class="pic_img"><img src="./assets/myMessage.png" alt="" /></div>
 					<div @click="goTo('/mine')">个人中心</div>
 				</div>
-				<div class="box_right_three" v-if="this.$store.state.isLogin">
+				<div class="box_right_three">
 					<div class="pic_img"><img src="./assets/mine.png" alt="" /></div>
 					<div>
 						{{
@@ -21,14 +21,14 @@
 						}}
 					</div>
 				</div>
-				<div class="user_head" v-if="this.$store.state.isLogin" @click="exit">
+				<div class="user_head" @click="exit">
 					<div>
 						<i class="exitI"></i>
 						<el-button type="text" style="color: white">退出</el-button>
 					</div>
 				</div>
 			</div>
-		</div>
+		</div> -->
 		<div>
 			<!-- main 内容 -->
 			<keep-alive v-if="$route.meta.keepAlive">
@@ -50,7 +50,7 @@
 				:luyou="this.$store.state.luyou"
 			></footer-nav> -->
 		</div>
-		<div class="bottom" v-if="this.$store.state.isLogin">
+		<!-- <div class="bottom">
 			<div class="bottom_flex">
 				<div class="left_bottom_flex">
 					<div class="left_title">联系我们</div>
@@ -66,7 +66,7 @@
 					<img src="./assets/logo2.png" alt="" />
 				</div>
 			</div>
-		</div>
+		</div> -->
 	</div>
 </template>
 
@@ -81,7 +81,7 @@
 		},
 		components: {},
 		created: function () {
-			this.isLogin();
+			// this.isLogin();
 			// this.getnCount();
 			setInterval(() => {
 				// this.getnCount();
@@ -107,17 +107,18 @@
 					if (router_path == "/") {
 						this.$router.push("/index");
 					}
-				} else {
-					this.$store.commit("update", ["isLogin", false]);
-					Message({
-						message: "未登录,请登录",
-						type: "warning",
-					});
-					setTimeout(() => {
-						loading.close();
-						this.$router.push("/login");
-					}, 2000);
 				}
+				//  else {
+				// 	this.$store.commit("update", ["isLogin", false]);
+				// 	Message({
+				// 		message: "未登录,请登录",
+				// 		type: "warning",
+				// 	});
+				// 	setTimeout(() => {
+				// 		loading.close();
+				// 		this.$router.push("/login");
+				// 	}, 2000);
+				// }
 			},
 			getnCount() {
 				let params = {

+ 4 - 3
src/components/courseDetail.vue

@@ -115,6 +115,7 @@
 				choose: 0,
 				dialogVisible: false,
 				id: this.$route.query.courseId,
+				userid: this.$route.query.userid,
 				courseDetail: {},
 				aStudentName: [],
 				chapInfo: [],
@@ -129,13 +130,13 @@
 				this.$router.push(path);
 			},
 			addUserRate(i) {
-				var suid = this.$store.state.studentInfo.userid;
+				var suid = this.userid;
 				if (JSON.parse(this.courseDetail.course_student).indexOf(suid) == -1 && JSON.parse(this.courseDetail.userid) != suid) {
 					this.$message.error("你没有该权限");
 					return;
 				}
 				let params = {
-					uid: this.$store.state.studentInfo.userid,
+					uid: this.userid,
 					cid: this.id,
 				};
 				this.ajax
@@ -143,7 +144,7 @@
 					.then((res) => {
 						console.log(res.data);
 						this.updateVc();
-						this.goTo("/study?type=" + i + "&courseId=" + this.id);
+						this.goTo("/study?type=" + i + "&courseId=" + this.id + '&userid=' + this.userid);
 					})
 					.catch((err) => {
 						console.error(err);

+ 7 - 5
src/components/index.vue

@@ -11,7 +11,7 @@
 								class="imgS"
 								:src="item.poster"
 								alt=""
-								@click.stop="goTo('/courseDetail?courseId=' + item.url)"
+								@click.stop="goTo('/courseDetail?courseId=' + item.url + '&userid=' + userid)"
 							/>
 						</el-carousel-item>
 					</el-carousel>
@@ -58,7 +58,7 @@
 								</div>
 								<div
 									class="now_study"
-									@click="goTo('/courseDetail?courseId=' + item.courseId)"
+									@click="goTo('/courseDetail?courseId=' + item.courseId + '&userid=' + userid)"
 								>
 									立即学习
 								</div>
@@ -105,6 +105,8 @@
 				isListAjax: false,
 				zoneListId: "",
 				bannerList: [],
+				userid: this.$route.query.userid,
+				oid: this.$route.query.oid,
 			};
 		},
 		methods: {
@@ -131,7 +133,7 @@
 				const loading = this.openLoading(document.querySelector(".main_box"));
 				let params = {
 					bid: zid,
-					oid: this.$store.state.studentInfo.organizeid,
+					oid: this.oid,
 					page: this.page,
 				};
 				this.ajax
@@ -152,7 +154,7 @@
 				this.isListAjax = true;
 				const loading = this.openLoading(document.querySelector(".main_box"));
 				let params = {
-					oid: this.$store.state.studentInfo.organizeid,
+					oid: this.oid,
 					page: this.page,
 				};
 				this.ajax
@@ -197,7 +199,7 @@
 		created() {
 			this.getZone();
 			this.getBanner();
-      document.scrollingElement.scrollTop = 0;
+      		document.scrollingElement.scrollTop = 0;
 		},
 	};
 </script>

+ 5 - 4
src/components/mine.vue

@@ -37,13 +37,13 @@
 				</div>
 				<div class="student_body">
 					<div class="box_three_pic">
-						<div class="pic_box" @click="goTo('/project')">
+						<div class="pic_box" @click="goTo('/project?userid=' + userid)">
 							<div class="mine_pic">
 								<img src="../assets/book.png" alt="" />
 							</div>
 							<div>我的课程</div>
 						</div>
-						<div class="pic_box" @click="goTo('/works')">
+						<div class="pic_box" @click="goTo('/works?userid=' + userid)">
 							<div class="mine_pic">
 								<img src="../assets/zp.png" alt="" />
 							</div>
@@ -55,7 +55,7 @@
 							</div>
 							<div>学习数据</div>
 						</div>
-						<div class="pic_box" @click="goTo('/notice')">
+						<div class="pic_box" @click="goTo('/notice?userid=' + userid)">
 							<div class="mine_pic">
 								<img src="../assets/notice.png" alt="" />
 							</div>
@@ -74,6 +74,7 @@
 			return {
 				studentMessage: [],
 				tx: require("../assets/tx.png"),
+				userid: this.$route.query.userid,
 			};
 		},
 		methods: {
@@ -82,7 +83,7 @@
 			},
 			selectSDetail() {
 				let params = {
-					uid: this.$store.state.studentInfo.userid,
+					uid: this.userid,
 				};
 				this.ajax
 					.get(this.$store.state.api + "selectSDetail", params)

+ 5 - 4
src/components/notice.vue

@@ -38,7 +38,7 @@
 				<div class="student_body">
 					<div style="padding: 20px 30px">
 						<el-breadcrumb separator-class="el-icon-arrow-right">
-							<el-breadcrumb-item :to="{ path: '/mine' }"
+							<el-breadcrumb-item :to="{ path: '/mine?userid=' + userid }"
 								>个人中心</el-breadcrumb-item
 							>
 							<el-breadcrumb-item>消息通知</el-breadcrumb-item>
@@ -53,7 +53,7 @@
 							>
 								<div
 									class="notice_title"
-									@click="goTo('/noticeDetail?newsid=' + item.newsid)"
+									@click="goTo('/noticeDetail?newsid=' + item.newsid + '&userid=' + userid)"
 								>
 									{{ item.title }}
 								</div>
@@ -93,6 +93,7 @@
 				newMessage: [],
 				tx: require("../assets/tx.png"),
 				page: 1,
+				userid: this.$route.query.userid,
 			};
 		},
 		methods: {
@@ -101,7 +102,7 @@
 			},
 			selectSDetail() {
 				let params = {
-					uid: this.$store.state.studentInfo.userid,
+					uid: this.userid,
 				};
 				this.ajax
 					.get(this.$store.state.api + "selectSDetail", params)
@@ -114,7 +115,7 @@
 			},
 			getNews() {
 				let params = {
-					uid: this.$store.state.studentInfo.userid,
+					uid: this.userid,
 					page: this.page,
 				};
 				this.ajax

+ 4 - 3
src/components/noticeDetail.vue

@@ -26,10 +26,10 @@
 				<div class="student_body">
 					<div style="padding: 20px 30px">
 						<el-breadcrumb separator-class="el-icon-arrow-right">
-							<el-breadcrumb-item :to="{ path: '/mine' }"
+							<el-breadcrumb-item :to="{ path: '/mine?userid=' + userid }"
 								>个人中心</el-breadcrumb-item
 							>
-							<el-breadcrumb-item :to="{ path: '/notice' }"
+							<el-breadcrumb-item :to="{ path: '/notice?userid=' + userid }"
 								>消息通知</el-breadcrumb-item
 							>
 							<el-breadcrumb-item>{{
@@ -61,6 +61,7 @@
 				newDetailMessage: [],
 				tx: require("../assets/tx.png"),
 				newsid: this.$route.query.newsid,
+				userid: this.$route.query.userid,
 			};
 		},
 		methods: {
@@ -69,7 +70,7 @@
 			},
 			selectSDetail() {
 				let params = {
-					uid: this.$store.state.studentInfo.userid,
+					uid: this.userid,
 				};
 				this.ajax
 					.get(this.$store.state.api + "selectSDetail", params)

+ 6 - 5
src/components/project.vue

@@ -38,7 +38,7 @@
 				<div class="student_body">
 					<div style="padding: 20px 30px">
 						<el-breadcrumb separator-class="el-icon-arrow-right">
-							<el-breadcrumb-item :to="{ path: '/mine' }"
+							<el-breadcrumb-item :to="{ path: '/mine?userid=' + userid }"
 								>个人中心</el-breadcrumb-item
 							>
 							<el-breadcrumb-item>我的课程</el-breadcrumb-item>
@@ -52,7 +52,7 @@
 						>
 							<div
 								class="project"
-								@click="goTo('/courseDetail?courseId=' + item.courseid)"
+								@click="goTo('/courseDetail?courseId=' + item.courseid + '&userid=' + userid)"
 							>
 								<img
 									:src="
@@ -66,7 +66,7 @@
 							<div class="projct_nav">
 								<div
 									style="font-size: 18px"
-									@click="goTo('/courseDetail?courseId=' + item.courseid)"
+									@click="goTo('/courseDetail?courseId=' + item.courseid + '&userid=' + userid)"
 								>
 									{{ item.title }}
 								</div>
@@ -94,6 +94,7 @@
 				studentMessage: [],
 				tx: require("../assets/tx.png"),
 				mpj: require("../assets/project.png"),
+				userid: this.$route.query.userid,
 			};
 		},
 		methods: {
@@ -102,7 +103,7 @@
 			},
 			selectSDetail() {
 				let params = {
-					uid: this.$store.state.studentInfo.userid,
+					uid: this.userid,
 				};
 				this.ajax
 					.get(this.$store.state.api + "selectSDetail", params)
@@ -116,7 +117,7 @@
 			},
 			selectMyCourse() {
 				let params = {
-					uid: this.$store.state.studentInfo.userid,
+					uid: this.userid,
 				};
 				this.ajax
 					.get(this.$store.state.api + "selectMyCourseBycid", params)

+ 5 - 4
src/components/score.vue

@@ -26,10 +26,10 @@
 				<div class="student_body">
 					<div style="padding: 20px 30px">
 						<el-breadcrumb separator-class="el-icon-arrow-right">
-							<el-breadcrumb-item :to="{ path: '/mine' }"
+							<el-breadcrumb-item :to="{ path: '/mine?userid=' + userid }"
 								>个人中心</el-breadcrumb-item
 							>
-							<el-breadcrumb-item :to="{ path: '/works' }"
+							<el-breadcrumb-item :to="{ path: '/works?userid=' + userid }"
 								>我的作品</el-breadcrumb-item
 							>
 							<el-breadcrumb-item>{{
@@ -112,6 +112,7 @@
 				chapInfo: [],
 				res: "",
 				courseId: this.$route.query.courseId,
+				userid: this.$route.query.userid,
 				stage: this.$route.query.stage,
 				myCourse: [],
 				playerOptions: {
@@ -263,7 +264,7 @@
 		methods: {
 			selectMyCourse() {
 				let params = {
-					uid: this.$store.state.studentInfo.userid,
+					uid: this.userid,
 				};
 				this.ajax
 					.get(this.$store.state.api + "selectMyCourse", params)
@@ -276,7 +277,7 @@
 			},
 			selectWorksDetail() {
 				let params = {
-					uid: this.$store.state.studentInfo.userid,
+					uid: this.userid,
 					cid: this.courseId,
 				};
 				this.ajax

+ 2 - 1
src/components/study.vue

@@ -230,6 +230,7 @@
 			return {
 				dialogVisible: false,
 				id: this.$route.query.courseId,
+				userid: this.$route.query.userid,
 				courseType: this.$route.query.type,
 				type: 1,
 				vedio: [],
@@ -535,7 +536,7 @@
 			addWork() {
 				let params = [
 					{
-						uid: this.$store.state.studentInfo.userid,
+						uid: this.userid,
 						cid: this.id,
 						stage: this.courseType,
 						content: JSON.stringify(this.studyJuri),

+ 5 - 4
src/components/works.vue

@@ -38,7 +38,7 @@
 				<div class="student_body">
 					<div style="padding: 20px 30px">
 						<el-breadcrumb separator-class="el-icon-arrow-right">
-							<el-breadcrumb-item :to="{ path: '/mine' }"
+							<el-breadcrumb-item :to="{ path: '/mine?userid=' + userid }"
 								>个人中心</el-breadcrumb-item
 							>
 							<el-breadcrumb-item>我的作品</el-breadcrumb-item>
@@ -74,7 +74,7 @@
 							</div>
 							<div
 								class="look_score"
-								@click="goTo('/score?courseId=' + item.courseId + '&stage=' + item.stage) "
+								@click="goTo('/score?courseId=' + item.courseId + '&userid=' + userid + '&stage=' + item.stage) "
 							>
 								查看评分
 							</div>
@@ -94,6 +94,7 @@
 				studentMessage: [],
 				tx: require("../assets/tx.png"),
 				mpj: require("../assets/project.png"),
+				userid: this.$route.query.userid,
 			};
 		},
 		methods: {
@@ -102,7 +103,7 @@
 			},
 			selectSDetail() {
 				let params = {
-					uid: this.$store.state.studentInfo.userid,
+					uid: this.userid,
 				};
 				this.ajax
 					.get(this.$store.state.api + "selectSDetail", params)
@@ -116,7 +117,7 @@
 			},
 			selectMyCourse() {
 				let params = {
-					uid: this.$store.state.studentInfo.userid,
+					uid: this.userid,
 				};
 				this.ajax
 					.get(this.$store.state.api + "selectMyCourse", params)

+ 2 - 2
src/config/config.js

@@ -9,8 +9,8 @@ const store = new Vuex.Store({
         luyou:1,
         userInfo: {},
         nCount:0,
-        // api: 'https://pbl.cocorobo.cn/api/pbl/',
-        api: 'http://localhost:7003/pbl/',
+        api: 'https://pbl.cocorobo.cn/api/pbl/',
+        // api: 'http://localhost:7003/api/pbl/',
     },
 
     mutations: {

+ 14 - 14
src/router/index.js

@@ -17,11 +17,11 @@ Vue.use(Router).use(ElementUI)
 
 export default new Router({
   routes: [
-    {
-      path: '/login',
-      name: 'login',
-      component: login
-    },
+    // {
+    //   path: '/login',
+    //   name: 'login',
+    //   component: login
+    // },
     {
       path:'/',
       redirect:'/index'
@@ -30,55 +30,55 @@ export default new Router({
       path: '/index',
       name: 'index',
       component: index,
-      requireAuth:true
+      requireAuth:''
     },
     {
       path: '/courseDetail',
       name: 'courseDetail',
       component: courseDetail,
-      requireAuth: true
+      requireAuth: ''
     },
     {
       path: '/mine',
       name: 'mine',
       component: mine,
-      requireAuth: true
+      requireAuth: ''
     },
     {
       path: '/project',
       name: 'project',
       component: project,
-      requireAuth: true
+      requireAuth: ''
     },
     {
       path: '/works',
       name: 'works',
       component: works,
-      requireAuth: true
+      requireAuth: ''
     },
     {
       path: '/score',
       name: 'score',
       component: score,
-      requireAuth: true
+      requireAuth: ''
     },
     {
       path: '/notice',
       name: 'notice',
       component: notice,
-      requireAuth: true
+      requireAuth: ''
     },
     {
       path: '/noticeDetail',
       name: 'noticeDetail',
       component: noticeDetail,
-      requireAuth: true
+      requireAuth: ''
     },
     {
       path: '/study',
       name: 'study',
       component: study,
-      requireAuth: true
+      requireAuth: ''
     },
   ]
 })