diff --git a/vue/src/assets/styles/element-ui.scss b/vue/src/assets/styles/element-ui.scss index cbf5e84..011e86c 100644 --- a/vue/src/assets/styles/element-ui.scss +++ b/vue/src/assets/styles/element-ui.scss @@ -52,6 +52,10 @@ .el-scrollbar { height: 100%; + + .el-scrollbar__wrap { + -webkit-overflow-scrolling: touch; + } } .el-tree { @@ -67,6 +71,7 @@ .el-message { @include deep-shadow; + @include max-mobile-width; border-width: 0; overflow: visible; @@ -122,6 +127,7 @@ .el-message-box { position: relative; @include deep-shadow; + @include max-mobile-width; } .el-notification { diff --git a/vue/src/assets/styles/nprogress.scss b/vue/src/assets/styles/nprogress.scss index e92b399..11eab2b 100644 --- a/vue/src/assets/styles/nprogress.scss +++ b/vue/src/assets/styles/nprogress.scss @@ -3,7 +3,6 @@ #nprogress { .bar { background: $--color-primary; - height: 5px; .peg { box-shadow: 0 0 10px $--color-primary, 0 0 5px $--color-primary;; diff --git a/vue/src/assets/styles/sidebar.scss b/vue/src/assets/styles/sidebar.scss index 73559c8..4c505b7 100644 --- a/vue/src/assets/styles/sidebar.scss +++ b/vue/src/assets/styles/sidebar.scss @@ -40,7 +40,6 @@ $iconSize: 17px; height: 50px; line-height: 50px; text-align: center; - overflow: hidden; & .sidebar-logo-link { height: 100%; @@ -123,6 +122,12 @@ $iconSize: 17px; overflow: hidden; } + &.el-menu--popup { + max-height: 88vh; + margin-bottom: 0.5vh; + overflow-y: auto; + } + .el-submenu__title i { color: inherit; } diff --git a/vue/src/assets/styles/variables.scss b/vue/src/assets/styles/variables.scss index 6191025..1ed50e4 100644 --- a/vue/src/assets/styles/variables.scss +++ b/vue/src/assets/styles/variables.scss @@ -30,6 +30,12 @@ $--color-info: $--color-teal; box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12); } +@mixin max-mobile-width { + @media (max-width: 768px) { + max-width: 384px; + } +} + // sidebar //$menuText: #bfcbd9; $menuText: #D6E2F0; diff --git a/vue/src/config/index.js b/vue/src/config/index.js index ac1eff1..353ce47 100644 --- a/vue/src/config/index.js +++ b/vue/src/config/index.js @@ -4,6 +4,9 @@ module.exports = { //全局axios的baseUrl apiPrefix: '/api', + //路由模式,['hash','history'] + routerMode: 'history', + //socket连接地址 //socketUrl: 'wss://toesbieya.cn', socketUrl: 'localhost:12580', diff --git a/vue/src/layout/components/Sidebar/index.vue b/vue/src/layout/components/Sidebar/index.vue index 1a4a582..86aca18 100644 --- a/vue/src/layout/components/Sidebar/index.vue +++ b/vue/src/layout/components/Sidebar/index.vue @@ -1,36 +1,4 @@ - - - diff --git a/vue/src/router/index.js b/vue/src/router/index.js index 7fff6e5..d39677d 100644 --- a/vue/src/router/index.js +++ b/vue/src/router/index.js @@ -17,7 +17,7 @@ import NProgress from 'nprogress' import {isUserExist} from "@/utils/sessionStorage" import {auth, needAuth} from "@/utils/auth" import {isEmpty} from "@/utils" -import {title} from '@/config' +import {title, routerMode} from '@/config' import constantRoutes from '@/router/constantRoutes' import authorityRoutes from '@/router/authorityRoutes' import store from "@/store" @@ -36,6 +36,7 @@ metaExtend(constantRoutes) metaExtend(authorityRoutes) const router = new Router({ + mode: routerMode, scrollBehavior: () => ({y: 0}), routes: constantRoutes.concat(authorityRoutes, endRoute) }) diff --git a/vue/src/views/app/login.vue b/vue/src/views/app/login.vue index 7aeaa12..c6740e5 100644 --- a/vue/src/views/app/login.vue +++ b/vue/src/views/app/login.vue @@ -116,9 +116,9 @@ }, success() { elSuccess('登陆成功') - let redirect = this.$route.query.redirect || '/' - //由于清除消息时会造成卡顿,所以延迟0.5s跳转 - setTimeout(() => window.location.href = '/#' + redirect, 500) + const redirect = this.$route.query.redirect || '/' + //由于清除消息时会造成卡顿,所以延迟0.2s跳转 + setTimeout(() => this.$router.push(redirect), 200) }, capsLockTip({keyCode}) { if (keyCode === 20) this.capsTooltip = !this.capsTooltip diff --git a/vue/vue.config.js b/vue/vue.config.js index a6e41eb..51205b7 100644 --- a/vue/vue.config.js +++ b/vue/vue.config.js @@ -12,7 +12,7 @@ const port = process.env.port || 8079 // dev port // All configuration item explanations can be find in https://cli.vuejs.org/config/ module.exports = { - publicPath: './', + publicPath: settings.routerMode === 'history' ? '/' : './', outputDir: 'dist', assetsDir: 'static', runtimeCompiler: true,