Commit 257efd23 authored by 黎博's avatar 黎博

登录首页更换及其他小优化

parent ab2fa617
...@@ -264,16 +264,16 @@ router.beforeEach(function(to, from, next) { ...@@ -264,16 +264,16 @@ router.beforeEach(function(to, from, next) {
var token = window.sessionStorage.getItem('token') var token = window.sessionStorage.getItem('token')
if (token !== null) { if (token !== null) {
if (to.path === '/login') { if (to.path === '/login') {
next('/main') next('/index/list')
NProgress.done() // 结束Progress NProgress.done() // 结束Progress
} else if (to.path === '/main') { } else if (to.path === '/index/list') {
next() next()
} else { } else {
var menuList = window.sessionStorage.getItem('menuList') var menuList = window.sessionStorage.getItem('menuList')
if (menuList.indexOf(to.path) > -1) { if (menuList.indexOf(to.path) > -1) {
next() next()
} else { } else {
next('/main') next('/index/list')
NProgress.done() // 结束Progress NProgress.done() // 结束Progress
} }
} }
......
...@@ -3,12 +3,12 @@ const state = { ...@@ -3,12 +3,12 @@ const state = {
isCollapse: false, // 是否收缩左侧导航栏 false为展开 true为收缩 isCollapse: false, // 是否收缩左侧导航栏 false为展开 true为收缩
asideTitle: [ asideTitle: [
{ {
title: '主页', title: '导航页面列表',
path: '/main', path: '/index/list',
activeIndex: 0 activeIndex: 0
} }
], // 存储点击左侧导航栏后的导航名,作为标题显示头 ], // 存储点击左侧导航栏后的导航名,作为标题显示头
crumbs: ['测试平台', '主页'], // 存储面包屑 crumbs: ['测试平台', '导航页面列表'], // 存储面包屑
activeIndex: 0, // 当前活跃的标题下标 activeIndex: 0, // 当前活跃的标题下标
count: 0 // 下标增值变量 count: 0 // 下标增值变量
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
<!-- 同步MQ对话框 --> <!-- 同步MQ对话框 -->
<el-dialog title="同步MQ" :visible.sync="mqSyncDialogVisible" width="50%" :before-close="handleClose"> <el-dialog title="同步MQ" :visible.sync="mqSyncDialogVisible" width="50%">
<el-form ref="mqDataForm" label-position="left" label-width="130px" style="width: 95%; margin-left:20px;"> <el-form ref="mqDataForm" label-position="left" label-width="130px" style="width: 95%; margin-left:20px;">
<el-form-item label="Namespace名称"> <el-form-item label="Namespace名称">
<el-input v-model="namespace" :disabled="true" /> <el-input v-model="namespace" :disabled="true" />
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
<!-- 同步MQ对话框 --> <!-- 同步MQ对话框 -->
<el-dialog title="同步MQ" :visible.sync="mqSyncDialogVisible" width="50%" :before-close="handleClose"> <el-dialog title="同步MQ" :visible.sync="mqSyncDialogVisible" width="50%">
<el-form ref="mqDataForm" label-position="left" label-width="130px" style="width: 95%; margin-left:20px;"> <el-form ref="mqDataForm" label-position="left" label-width="130px" style="width: 95%; margin-left:20px;">
<el-form-item label="Namespace名称"> <el-form-item label="Namespace名称">
<el-input v-model="namespace" :disabled="true" /> <el-input v-model="namespace" :disabled="true" />
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
pageSize: 10 pageSize: 10
}, },
loginInfoList: [], loginInfoList: [],
totalNum: '', totalNum: 0,
whiteListType: [ whiteListType: [
{ {
label: '设备维度', label: '设备维度',
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
:class="{title: true, active: (active === item.activeIndex)?true:false, marginR: (index != getAsideTitle.length - 1)}" :class="{title: true, active: (active === item.activeIndex)?true:false, marginR: (index != getAsideTitle.length - 1)}"
@click="toUrl(item.path, item.activeIndex)" @click="toUrl(item.path, item.activeIndex)"
@close="closeTag(item.title, item.activeIndex)" @close="closeTag(item.title, item.activeIndex)"
:closable="(item.title == '主页')? false : true" :closable="(item.title == '导航页面列表')? false : true"
> >
{{item.title}} {{item.title}}
</el-tag> </el-tag>
......
...@@ -65,7 +65,9 @@ export default { ...@@ -65,7 +65,9 @@ export default {
} else { } else {
// 将token放到Application中 // 将token放到Application中
window.sessionStorage.setItem('token', resp.data.data.token) window.sessionStorage.setItem('token', resp.data.data.token)
this.$router.push('/main') // 设置当前选中的菜单
window.sessionStorage.setItem('activePath', '/index/list')
this.$router.push('/index/list')
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -103,8 +105,8 @@ export default { ...@@ -103,8 +105,8 @@ export default {
} }
.loginForm { .loginForm {
padding: 20px; padding: 20px;
background: rgba(38, 41, 46, 0.43); background: rgba(48, 49, 51, 0.43);
box-shadow: 6px 5px 5px 0px rgb(36, 41, 41); box-shadow: 4px 4px 4px 0px rgb(36, 41, 41);
} }
.title { .title {
text-align: center; text-align: center;
......
...@@ -215,7 +215,7 @@ export default { ...@@ -215,7 +215,7 @@ export default {
}, },
successJson: '', successJson: '',
failJson: '', failJson: '',
totalNum: '' totalNum: 0
} }
}, },
components: { components: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment