v1.0.2 优化home页面的name取值方式

This commit is contained in:
zhuoda 2020-01-11 08:50:02 +08:00
parent 23c20820e2
commit e55e1b2f33
2 changed files with 11 additions and 4 deletions

View File

@ -7,11 +7,11 @@
</p>
<br/>
<p style="text-align:left;font-size:16px">
<font color="#DC143C"><strong>我们开源一套漂亮的代码和一套整洁的代码规范</strong></font>让大家在这浮躁的代码世界里感受到一股把代码写好的清流同时又让开发者节省大量的时间减少加班快乐工作热爱生活
我们开源一套漂亮的代码和一套整洁的代码规范让大家在这浮躁的代码世界里感受到一股把代码写好的清流同时又让开发者节省大量的时间减少加班快乐工作热爱生活
</p>
<br/>
<p style="text-align:left;font-size:16px">
<font color="#DC143C"><strong>你的star 是我们最强的动力感谢支持 => </strong></font>
<p style="text-align:left;font-size:20px">
<font color="#DC143C"><strong>你的star 是我们最强的动力感谢支持 (^_^) &nbsp;&nbsp;&nbsp;&nbsp; </strong></font>
<a target="_blank" href="https://github.com/1024-lab/smart-admin">
<img style="width: 82px;height: 20px;margin-right: 10px" alt="" src="https://img.shields.io/github/stars/1024-lab/smart-admin.svg?logo=github&style=social">
</a>

View File

@ -6,6 +6,9 @@ import iView from 'iview';
import cookie from '@/lib/cookie';
import { localRead } from '@/lib/local';
import { setTitle } from '@/lib/menu-func';
import config from '@/config';
const { homeName } = config;
Vue.use(Router);
const router = new Router({
@ -62,8 +65,12 @@ router.beforeEach((to, from, next) => {
} else if (token && to.name === LOGIN_PAGE_NAME) {
// 已登录且要跳转的页面是登录页
next({
name: 'home' // 跳转到home页
// 跳转到home页
name: homeName
});
setTitle(to, router.app);
iView.LoadingBar.finish();
window.scrollTo(0, 0);
} else {
// 特殊页面直接放行
if (to.meta.access) {