Skip to content

Commit 9b97d4b

Browse files
committed
调整布局方式
1 parent 88ee79b commit 9b97d4b

File tree

11 files changed

+89
-101
lines changed

11 files changed

+89
-101
lines changed

src/components/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import Menus from './menus';
2-
31
const components = {
4-
Menus,
52
};
63

74
const install = (Vue) => {

src/layout/Layout.vue

Lines changed: 0 additions & 72 deletions
This file was deleted.

src/layout/header/Index.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export default {
7676
},
7777
methods: {
7878
logout () {
79+
console.log('退出登录');
7980
storage.removeItem(authToken);
8081
storage.removeItem(currentUser);
8182
this.$router.push({ name: 'login' });
@@ -141,11 +142,13 @@ export default {
141142
width: 240px;
142143
height: 40px;
143144
background: rgba(255, 255, 255, 0.2);
145+
transition: all 0.3s ease-in-out;
144146
}
145147
.log2 {
146148
width: 65px;
147149
height: 40px;
148150
background: rgba(255, 255, 255, 0.2);
151+
transition: all 0.3s ease-in-out;
149152
}
150153
}
151154
.menus {

src/layout/index.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/layout/sidebar/Index.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
</template>
77

88
<script>
9-
export default {}
9+
import Menus from './menus/Menus.vue';
10+
export default {
11+
components: {
12+
Menus,
13+
}
14+
}
1015
</script>
1116

1217
<style lang="scss" scoped>

src/components/menus/Menus.vue renamed to src/layout/sidebar/menus/Menus.vue

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ export default {
5555

5656
<style scoped lang="scss">
5757
.sidebar {
58-
/* display: block;
59-
position: absolute;
60-
left: 0;
61-
top: 70px;
62-
bottom: 0;
63-
overflow-y: scroll; */
64-
/* float: left; */
6558
display: block;
6659
position: absolute;
6760
left: 0;
File renamed without changes.

src/router/router.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,16 @@ import { authToken } from '@/config';
99
Vue.use(VueRouter)
1010

1111
const routes = [
12+
1213
{
13-
name: '',
14+
name: '/',
1415
path: '/',
1516
meta: { title: 'Home' },
16-
component: () => import('@/layout'),
17-
redirect: '/home',
18-
children: [
19-
...home,
20-
...constantRoutes,
21-
],
17+
redirect: '/home'
2218
},
19+
...home,
2320
...login,
21+
...constantRoutes,
2422
]
2523

2624
const router = new VueRouter({
@@ -44,7 +42,7 @@ const auth = (to, from, next) => {
4442
title: '退出提示',
4543
message: '登录超时',
4644
});
47-
next({ name: 'login', query: { backUrl: to.fullPath } });
45+
next({ name: 'login', query: { backUrl: to.fullPath }, replace: true });
4846
}
4947
}
5048

@@ -56,10 +54,11 @@ const auth = (to, from, next) => {
5654
* @param {type}
5755
* @return:
5856
*/
57+
const whiteList = ['login'];
5958
const authRoutes = async (to, from, next) => {
6059
const routes = await store.dispatch('getMenuListApi');
6160
const routesUrlList = routes.map(item => item.index);
62-
if (routesUrlList.includes(to.name)) {
61+
if (routesUrlList.includes(to.name) || whiteList.includes(to.name)) {
6362
next({ ...to, replace: true });
6463
} else {
6564
next({ name: 'home', replace: true });

src/utils/storage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ class LocalStorage {
6363
* @Date: 2019-08-16 13:31:11
6464
*/
6565
removeItem (key) {
66-
key = this.getKey(key);
66+
// key = this.getKey(key);
6767
const value = this.getItem(key);
68+
console.log('===', key, value)
6869
if (value) {
6970
window.localStorage.removeItem(key);
7071
}

0 commit comments

Comments
 (0)