Browse Source

refactor: mock routers /account

Sendya 5 years ago
parent
commit
c74a9ee5fc
2 changed files with 106 additions and 1 deletions
  1. 93 0
      src/mock/services/user.js
  2. 13 1
      src/router/generator-routers.js

+ 93 - 0
src/mock/services/user.js

@@ -664,6 +664,99 @@ const userNav = (options) => {
         'show': true
       },
       'component': 'Exception500'
+    },
+
+    // account
+    {
+      'name': 'account',
+      'parentId': -1,
+      'id': 10028,
+      'meta': {
+        'title': '个人页',
+        'icon': 'user',
+        'show': true
+      },
+      'redirect': '/account/center',
+      'component': 'RouteView'
+    },
+    {
+      'name': 'center',
+      'parentId': 10028,
+      'id': 10029,
+      'meta': {
+        'title': '个人中心',
+        'show': true
+      },
+      'component': 'AccountCenter'
+    },
+    // 特殊三级菜单
+    {
+      'name': 'settings',
+      'parentId': 10028,
+      'id': 10030,
+      'meta': {
+        'title': '个人设置',
+        'hideHeader': true,
+        'hideChildren': true,
+        'show': true
+      },
+      'redirect': '/account/settings/base',
+      'component': 'AccountSettings'
+    },
+    {
+      'name': 'BaseSettings',
+      'path': '/account/settings/base',
+      'parentId': 10030,
+      'id': 10031,
+      'meta': {
+        'title': '基本设置',
+        'show': false
+      },
+      'component': 'BaseSettings'
+    },
+    {
+      'name': 'SecuritySettings',
+      'path': '/account/settings/security',
+      'parentId': 10030,
+      'id': 10032,
+      'meta': {
+        'title': '安全设置',
+        'show': false
+      },
+      'component': 'SecuritySettings'
+    },
+    {
+      'name': 'CustomSettings',
+      'path': '/account/settings/custom',
+      'parentId': 10030,
+      'id': 10033,
+      'meta': {
+        'title': '个性化设置',
+        'show': false
+      },
+      'component': 'CustomSettings'
+    },
+    {
+      'name': 'BindingSettings',
+      'path': '/account/settings/binding',
+      'parentId': 10030,
+      'id': 10034,
+      'meta': {
+        'title': '账户绑定',
+        'show': false
+      },
+      'component': 'BindingSettings'
+    },
+    {
+      'name': 'NotificationSettings',
+      'path': '/account/settings/notification',
+      'parentId': 10030,
+      'id': 10034,
+      'meta': {
+        'title': '新消息通知',
+        'show': false
+      },
+      'component': 'NotificationSettings'
     }
   ]
   return builder(nav)

+ 13 - 1
src/router/generator-routers.js

@@ -25,7 +25,7 @@ const constantRouterComponents = {
 
   // list
   'TableList': () => import('@/views/list/TableList'),
-  'BasicList': () => import('@/views/list/StandardList'),
+  'StandardList': () => import('@/views/list/StandardList'),
   'CardList': () => import('@/views/list/CardList'),
   'SearchLayout': () => import('@/views/list/search/SearchLayout'),
   'SearchArticles': () => import('@/views/list/search/Article'),
@@ -33,13 +33,25 @@ const constantRouterComponents = {
   'SearchApplications': () => import('@/views/list/search/Applications'),
   'ProfileBasic': () => import('@/views/profile/basic/Index'),
   'ProfileAdvanced': () => import('@/views/profile/advanced/Advanced'),
+
+  // result
   'ResultSuccess': () => import(/* webpackChunkName: "result" */ '@/views/result/Success'),
   'ResultFail': () => import(/* webpackChunkName: "result" */ '@/views/result/Error'),
 
+  // exception
   'Exception403': () => import(/* webpackChunkName: "fail" */ '@/views/exception/403'),
   'Exception404': () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'),
   'Exception500': () => import(/* webpackChunkName: "fail" */ '@/views/exception/500'),
 
+  // account
+  'AccountCenter': () => import('@/views/account/center/Index'),
+  'AccountSettings': () => import('@/views/account/settings/Index'),
+  'BaseSettings': () => import('@/views/account/settings/BaseSetting'),
+  'SecuritySettings': () => import('@/views/account/settings/Security'),
+  'CustomSettings': () => import('@/views/account/settings/Custom'),
+  'BindingSettings': () => import('@/views/account/settings/Binding'),
+  'NotificationSettings': () => import('@/views/account/settings/Notification'),
+
   'TestWork': () => import(/* webpackChunkName: "TestWork" */ '@/views/dashboard/TestWork')
 }