|
|
@@ -135,6 +135,11 @@ const routes = [
|
|
|
path: "/courseWare/:courseWareId/details",
|
|
|
name: "courseWareDetails",
|
|
|
component: ()=>import("../views/CourseWarePage/CourseWarePage")
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: "/empty/:courseWareId",
|
|
|
+ name: "empty",
|
|
|
+ component: ()=>import("../views/CourseWarePage/pdf/Empty")
|
|
|
}
|
|
|
];
|
|
|
|
|
|
@@ -148,10 +153,7 @@ const unauthorizedRoutes = ["Portal", "Auth", "Course", "Test","Project", "Compl
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
let token = localStorage.getItem("token");
|
|
|
console.log(token);
|
|
|
- if (unauthorizedRoutes.indexOf(to.name) !== -1) {
|
|
|
- console.log(1);
|
|
|
- next();
|
|
|
- }
|
|
|
+
|
|
|
// else if (token && to.name === "courseWareDetails") {
|
|
|
// console.log(localStorage);
|
|
|
// if (localStorage.s === "true") {
|
|
|
@@ -159,6 +161,9 @@ router.beforeEach((to, from, next) => {
|
|
|
// next();
|
|
|
// }
|
|
|
// }
|
|
|
+ if (unauthorizedRoutes.indexOf(to.name) !== -1) {
|
|
|
+ next();
|
|
|
+ }
|
|
|
else if (!store.state.user.token) {
|
|
|
ElMessage({
|
|
|
showClose: true,
|