上传封面
+展示宽度为220,高度140,JPG/PNG/GIF,3MB以内
+上传封面
+展示宽度为1920,高度300,JPG/PNG/GIF,3MB以内
+diff --git a/src/App.vue b/src/App.vue index ff6d150..d5535d4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,6 +18,7 @@ export default { //在页面刷新时将vuex里的信息保存到localStorage里 window.addEventListener("beforeunload", () => { + sessionStorage.removeItem('handelPermission') util.local.get(Setting.tokenKey) && util.local.set(Setting.storeKey, this.$store.state); }); } diff --git a/src/layouts/navbar/index.vue b/src/layouts/navbar/index.vue index 100c131..d47cb17 100644 --- a/src/layouts/navbar/index.vue +++ b/src/layouts/navbar/index.vue @@ -94,8 +94,8 @@ export default { }; }, computed: { - ...mapState("auth", [ - "routes" + ...mapState([ + "routers" ]) }, watch: { @@ -112,16 +112,17 @@ export default { }, methods: { initMenu() { - if (Setting.dynamicRoute) { - let routes = this.routes; + // 原版的router是从vuex取得,需要把router数据再次存一份到vuex里即可。 + // if (Setting.dynamicRoute) { + // let routes = this.routes; let menus = []; this.defaultMenus.map(e => { - routes.find(n => n.path == e.index) && menus.push(e); + this.routers.find(n => n == e.index) && menus.push(e); }); this.menus = menus; - } else { - this.menus = this.defaultMenus; - } + // } else { + // this.menus = this.defaultMenus; + // } } } }; diff --git a/src/main.js b/src/main.js index 2f511f9..ba9cd52 100644 --- a/src/main.js +++ b/src/main.js @@ -36,13 +36,13 @@ const i18n = new VueI18n({ messages }); -function auth(values){ +Vue.prototype.auth = function(values){ // 直接拿值进行匹配,取得当前router的mate信息,传入,返回一个boolean,以此进行vif判断 // router.meta 信息匹配传进来的value,用vif去进行按钮级权限配置即可。 // $router.currentRoute.meta - + console.log(router.currentRoute.meta,'当前路由的按钮权限数组') + return router.currentRoute.meta.btn.some(e=>e===values) } -Vue.use(auth)// 鉴权函数 new Vue({ mixins: [mixinApp], router, diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue index e1edded..bfceb33 100644 --- a/src/pages/account/login/index.vue +++ b/src/pages/account/login/index.vue @@ -108,6 +108,7 @@ export default { this.login(this.param).then(() => { let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : "/index"; this.$router.replace(redirect); + console.log(redirect) }).catch(res => { }); } else { diff --git a/src/pages/course/courseManagement/add.vue b/src/pages/course/list/courseManagement/add.vue similarity index 100% rename from src/pages/course/courseManagement/add.vue rename to src/pages/course/list/courseManagement/add.vue diff --git a/src/pages/course/courseManagement/contentSettings.vue b/src/pages/course/list/courseManagement/contentSettings.vue similarity index 100% rename from src/pages/course/courseManagement/contentSettings.vue rename to src/pages/course/list/courseManagement/contentSettings.vue diff --git a/src/pages/course/courseManagement/index.vue b/src/pages/course/list/courseManagement/index.vue similarity index 100% rename from src/pages/course/courseManagement/index.vue rename to src/pages/course/list/courseManagement/index.vue diff --git a/src/pages/course/courseManagement/preview.vue b/src/pages/course/list/courseManagement/preview.vue similarity index 100% rename from src/pages/course/courseManagement/preview.vue rename to src/pages/course/list/courseManagement/preview.vue diff --git a/src/pages/course/index.vue b/src/pages/course/list/index.vue similarity index 100% rename from src/pages/course/index.vue rename to src/pages/course/list/index.vue diff --git a/src/pages/course/sortManagement/index.vue b/src/pages/course/list/sortManagement/index.vue similarity index 100% rename from src/pages/course/sortManagement/index.vue rename to src/pages/course/list/sortManagement/index.vue diff --git a/src/pages/evaluation/list/index.vue b/src/pages/evaluation/list/index.vue index 4a19884..f023930 100644 --- a/src/pages/evaluation/list/index.vue +++ b/src/pages/evaluation/list/index.vue @@ -20,7 +20,7 @@
上传封面
+展示宽度为220,高度140,JPG/PNG/GIF,3MB以内
+上传封面
+展示宽度为1920,高度300,JPG/PNG/GIF,3MB以内
+