diff --git a/.env b/.env new file mode 100644 index 0000000..a776eb8 --- /dev/null +++ b/.env @@ -0,0 +1,5 @@ +VUE_APP_NAME=admin +VUE_APP_ROUTES_KEY=admin.routes +VUE_APP_PERMISSIONS_KEY=admin.permissions +VUE_APP_ROLES_KEY=admin.roles +VUE_APP_USER_KEY=admin.user diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..a776eb8 --- /dev/null +++ b/.env.development @@ -0,0 +1,5 @@ +VUE_APP_NAME=admin +VUE_APP_ROUTES_KEY=admin.routes +VUE_APP_PERMISSIONS_KEY=admin.permissions +VUE_APP_ROLES_KEY=admin.roles +VUE_APP_USER_KEY=admin.user diff --git a/package.json b/package.json index cae6313..13150ea 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "enquire.js": "^2.1.6", "js-cookie": "^2.2.1", "mockjs": "^1.1.0", - "pouchdb": "^7.2.1", "viser-vue": "^2.4.8", "vue": "^2.6.11", "vue-i18n": "^8.18.2", diff --git a/src/bootstrap.js b/src/bootstrap.js new file mode 100644 index 0000000..b3f0226 --- /dev/null +++ b/src/bootstrap.js @@ -0,0 +1,18 @@ +import {loadRoutes, loginGuard, authorityGuard} from '@/utils/routerUtil' + +/** + * 启动引导方法 + * 应用启动时需要执行的操作放在这里 + * @param router 应用的路由实例 + * @param store 应用的 vuex.store 实例 + * @param i18n 应用的 vue-i18n 实例 + */ +function bootstrap({router, store, i18n}) { + // 加载路由 + loadRoutes({router, store, i18n}) + // 添加路由守卫 + loginGuard(router) + authorityGuard(router, store) +} + +export default bootstrap diff --git a/src/components/exception/ExceptionPage.vue b/src/components/exception/ExceptionPage.vue index 5c5316b..f9fb84a 100644 --- a/src/components/exception/ExceptionPage.vue +++ b/src/components/exception/ExceptionPage.vue @@ -7,7 +7,7 @@

{{config[type].title}}

{{config[type].desc}}
- 返回首页 + 返回首页
@@ -18,11 +18,19 @@ import Config from './typeConfig' export default { name: 'ExceptionPage', - props: ['type'], + props: ['type', 'homeRoute'], data () { return { config: Config } + }, + methods: { + backHome() { + if (this.homeRoute) { + this.$router.push(this.homeRoute) + } + this.$emit('backHome', this.type) + } } } diff --git a/src/config/default/setting.config.js b/src/config/default/setting.config.js index 64f381c..58a24a6 100644 --- a/src/config/default/setting.config.js +++ b/src/config/default/setting.config.js @@ -16,6 +16,7 @@ module.exports = { hideSetting: false, //隐藏设置抽屉,true:隐藏,false:不隐藏 systemName: 'Vue Antd Admin', //系统名称 copyright: '2018 ICZER 工作室出品', //copyright + asyncRoutes: false, //异步加载路由,true:开启,false:不开启 animate: { //动画设置 disabled: false, //禁用动画,true:禁用,false:启用 name: 'bounce', //动画效果,支持的动画效果可参考 ./animate.config.js diff --git a/src/layouts/AdminLayout.vue b/src/layouts/AdminLayout.vue index 932483b..80c364e 100644 --- a/src/layouts/AdminLayout.vue +++ b/src/layouts/AdminLayout.vue @@ -35,8 +35,6 @@ import {mapState, mapMutations} from 'vuex' const minHeight = window.innerHeight - 64 - 24 - 122 -let menuData = [] - export default { name: 'AdminLayout', components: {Setting, SideMenu, Drawer, PageFooter, AdminHeader}, @@ -44,12 +42,12 @@ export default { return { minHeight: minHeight, collapsed: false, - menuData: menuData, showSetting: false } }, computed: { - ...mapState('setting', ['isMobile', 'theme', 'layout', 'footerLinks', 'copyright', 'fixedHeader', 'fixedSideBar', 'hideSetting', 'pageMinHeight']), + ...mapState('setting', ['isMobile', 'theme', 'layout', 'footerLinks', 'copyright', 'fixedHeader', 'fixedSideBar', + 'hideSetting', 'menuData']), sideMenuWidth() { return this.collapsed ? '80px' : '256px' }, @@ -74,9 +72,6 @@ export default { }, beforeDestroy() { this.correctPageMinHeight(-minHeight + 1) - }, - beforeCreate () { - menuData = this.$router.options.routes.find((item) => item.path === '/').children } } diff --git a/src/layouts/header/HeaderlAvatar.vue b/src/layouts/header/HeaderlAvatar.vue index 256580a..5884727 100644 --- a/src/layouts/header/HeaderlAvatar.vue +++ b/src/layouts/header/HeaderlAvatar.vue @@ -25,13 +25,13 @@ diff --git a/src/pages/exception/404.vue b/src/pages/exception/404.vue index fa4edfa..d424216 100644 --- a/src/pages/exception/404.vue +++ b/src/pages/exception/404.vue @@ -1,5 +1,5 @@ diff --git a/src/pages/form/advance/index.js b/src/pages/form/advance/index.js new file mode 100644 index 0000000..22fb509 --- /dev/null +++ b/src/pages/form/advance/index.js @@ -0,0 +1,2 @@ +import AdvancedForm from '@/pages/form/advance/AdvancedForm' +export default AdvancedForm diff --git a/src/pages/form/basic/index.js b/src/pages/form/basic/index.js new file mode 100644 index 0000000..b046177 --- /dev/null +++ b/src/pages/form/basic/index.js @@ -0,0 +1,2 @@ +import BasicForm from './BasicForm' +export default BasicForm diff --git a/src/pages/form/step/index.js b/src/pages/form/step/index.js new file mode 100644 index 0000000..4b75f8f --- /dev/null +++ b/src/pages/form/step/index.js @@ -0,0 +1,2 @@ +import StepForm from './StepForm' +export default StepForm diff --git a/src/pages/login/Login.vue b/src/pages/login/Login.vue index f9f42e5..16d371b 100644 --- a/src/pages/login/Login.vue +++ b/src/pages/login/Login.vue @@ -75,8 +75,10 @@