Skip to content

Commit fe89166

Browse files
committed
chore: mock cleanup
1 parent 5dc05f9 commit fe89166

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

src/config/router.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,31 +232,31 @@ export const asyncRouterMap = [
232232
path: '/account/settings/base',
233233
name: 'BaseSettings',
234234
component: () => import('@/views/account/settings/BaseSetting'),
235-
meta: { title: '基本设置', hidden: true, permission: [ 'user' ] }
235+
meta: { title: '基本设置', permission: [ 'user' ] }
236236
},
237237
{
238238
path: '/account/settings/security',
239239
name: 'SecuritySettings',
240240
component: () => import('@/views/account/settings/Security'),
241-
meta: { title: '安全设置', hidden: true, keepAlive: true, permission: [ 'user' ] }
241+
meta: { title: '安全设置', keepAlive: true, permission: [ 'user' ] }
242242
},
243243
{
244244
path: '/account/settings/custom',
245245
name: 'CustomSettings',
246246
component: () => import('@/views/account/settings/Custom'),
247-
meta: { title: '个性化设置', hidden: true, keepAlive: true, permission: [ 'user' ] }
247+
meta: { title: '个性化设置', keepAlive: true, permission: [ 'user' ] }
248248
},
249249
{
250250
path: '/account/settings/binding',
251251
name: 'BindingSettings',
252252
component: () => import('@/views/account/settings/Binding'),
253-
meta: { title: '账户绑定', hidden: true, keepAlive: true, permission: [ 'user' ] }
253+
meta: { title: '账户绑定', keepAlive: true, permission: [ 'user' ] }
254254
},
255255
{
256256
path: '/account/settings/notification',
257257
name: 'NotificationSettings',
258258
component: () => import('@/views/account/settings/Notification'),
259-
meta: { title: '新消息通知', hidden: true, keepAlive: true, permission: [ 'user' ] }
259+
meta: { title: '新消息通知', keepAlive: true, permission: [ 'user' ] }
260260
}
261261
]
262262
}

src/mock/services/user.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,15 @@ const userNav = (options) => {
407407
}
408408
},
409409
{
410-
'name': 'analysis',
410+
'name': 'Analysis',
411411
'parentId': 1,
412412
'id': 2,
413413
'meta': {
414414
'title': '分析页',
415415
'show': true
416416
},
417-
'component': 'Analysis'
417+
'component': 'Analysis',
418+
'path': '/dashboard/analysis'
418419
},
419420
{
420421
'name': 'tests',

src/permission.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
1111
NProgress.configure({ showSpinner: false }) // NProgress Configuration
1212

1313
const whiteList = ['login', 'register', 'registerResult'] // no redirect whitelist
14+
const defaultRoutePath = '/dashboard/workplace'
1415

1516
router.beforeEach((to, from, next) => {
1617
NProgress.start() // start progress bar
1718
to.meta && (typeof to.meta.title !== 'undefined' && setDocumentTitle(`${to.meta.title} - ${domTitle}`))
1819
if (Vue.ls.get(ACCESS_TOKEN)) {
1920
/* has token */
2021
if (to.path === '/user/login') {
21-
next({ path: '/dashboard/workplace' })
22+
next({ path: defaultRoutePath })
2223
NProgress.done()
2324
} else {
2425
if (store.getters.roles.length === 0) {

src/store/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import Vuex from 'vuex'
44
import app from './modules/app'
55
import user from './modules/user'
66
import i18n from './modules/i18n'
7+
8+
// default router permission control
79
import permission from './modules/permission'
10+
11+
// dynamic router permission control (Experimental)
812
// import permission from './modules/async-router'
913
import getters from './getters'
1014

src/views/user/Login.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export default {
261261
})
262262
})
263263
*/
264-
this.$router.push({ name: 'analysis' })
264+
this.$router.push({ name: 'Analysis' })
265265
// 延迟 1 秒显示欢迎信息
266266
setTimeout(() => {
267267
this.$notification.success({

0 commit comments

Comments
 (0)