chao 3 лет назад
Родитель
Сommit
809b79743f

+ 0 - 41
src/api/article.js

@@ -1,41 +0,0 @@
-import request from '@/utils/request'
-
-export function fetchList(query) {
-  return request({
-    url: '/vue-element-admin/article/list',
-    method: 'get',
-    params: query
-  })
-}
-
-export function fetchArticle(id) {
-  return request({
-    url: '/vue-element-admin/article/detail',
-    method: 'get',
-    params: { id }
-  })
-}
-
-export function fetchPv(pv) {
-  return request({
-    url: '/vue-element-admin/article/pv',
-    method: 'get',
-    params: { pv }
-  })
-}
-
-export function createArticle(data) {
-  return request({
-    url: '/vue-element-admin/article/create',
-    method: 'post',
-    data
-  })
-}
-
-export function updateArticle(data) {
-  return request({
-    url: '/vue-element-admin/article/update',
-    method: 'post',
-    data
-  })
-}

+ 0 - 8
src/api/qiniu.js

@@ -1,8 +0,0 @@
-import request from '@/utils/request'
-
-export function getToken() {
-  return request({
-    url: '/qiniu/upload/token', // 假地址 自行替换
-    method: 'get'
-  })
-}

+ 0 - 17
src/api/remote-search.js

@@ -1,17 +0,0 @@
-import request from '@/utils/request'
-
-export function searchUser(name) {
-  return request({
-    url: '/vue-element-admin/search/user',
-    method: 'get',
-    params: { name }
-  })
-}
-
-export function transactionList(query) {
-  return request({
-    url: '/vue-element-admin/transaction/list',
-    method: 'get',
-    params: query
-  })
-}

+ 4 - 87
src/router/index.js

@@ -7,8 +7,8 @@ Vue.use(Router)
 import Layout from '@/layout'
 
 /* Router Modules */
-// import componentsRouter from './modules/components'
-// import chartsRouter from './modules/charts'
+import sysRouter from './modules/sys'
+import wechatRouter from './modules/wechat'
 // import tableRouter from './modules/table'
 // import nestedRouter from './modules/nested'
 
@@ -99,91 +99,8 @@ export const constantRoutes = [
  * the routes that need to be dynamically loaded based on user roles
  */
 export const asyncRoutes = [
-  {
-    path: '/sys',
-    component: Layout,
-    redirect: '/sys/menus',
-    alwaysShow: true, // will always show the root menu
-    name: 'SysSetting',
-    meta: { title: '系统设置', icon: 'el-icon-s-tools' },
-    children: [
-      {
-        path: 'menus',
-        component: () => import('@/views/sys/menus/index'),
-        redirect: '/sys/menus/list',
-        name: 'SysMenus',
-        meta: { title: '菜单管理', icon: 'el-icon-menu' },
-        children: [
-          {
-            path: 'list',
-            hidden: true,
-            component: () => import('@/views/sys/menus/list.vue'),
-            name: 'SysMenuList',
-            meta: { title: '菜单列表' }
-          },
-          {
-            path: 'form',
-            hidden: true,
-            component: () => import('@/views/sys/menus/form.vue'),
-            name: 'SysMenuForm',
-            meta: { title: '菜单编辑' }
-          }
-        ]
-      },
-      {
-        path: 'roles',
-        component: () => import('@/views/sys/roles/index'),
-        redirect: '/sys/roles/list',
-        name: 'SysRoles',
-        meta: { title: '角色列表', icon: 'lock' },
-        children: [
-          {
-            path: 'list',
-            hidden: true,
-            component: () => import('@/views/sys/roles/list.vue'),
-            name: 'SysRoles',
-            meta: { title: '角色列表' }
-          },
-          {
-            path: 'form',
-            hidden: true,
-            component: () => import('@/views/sys/roles/form.vue'),
-            name: 'SysRoles',
-            meta: { title: '添加角色' }
-          }
-        ]
-      },
-      {
-        path: 'users',
-        component: () => import('@/views/sys/users/index'),
-        redirect: '/sys/users/list',
-        name: 'SysUsers',
-        meta: { title: '用户列表', icon: 'user' },
-        children: [
-          {
-            path: 'list',
-            hidden: true,
-            component: () => import('@/views/sys/users/list.vue'),
-            name: 'SysUsers',
-            meta: { title: '角色列表' }
-          },
-          {
-            path: 'form',
-            hidden: true,
-            component: () => import('@/views/sys/users/form.vue'),
-            name: 'SysUsers',
-            meta: { title: '添加用户' }
-          }
-        ]
-      },
-      {
-        path: 'icons',
-        component: () => import('@/views/sys/icons/index'),
-        name: 'SysIcons',
-        meta: { title: '系统图标', icon: 'el-icon-picture', noCache: true }
-      }
-    ]
-  }
+  sysRouter,
+  wechatRouter
   /** when your routing map is too long, you can split it into small modules **/
   // componentsRouter,
   // chartsRouter,

+ 0 - 36
src/router/modules/charts.js

@@ -1,36 +0,0 @@
-/** When your routing table is too long, you can split it into small modules**/
-
-import Layout from '@/layout'
-
-const chartsRouter = {
-  path: '/charts',
-  component: Layout,
-  redirect: 'noRedirect',
-  name: 'Charts',
-  meta: {
-    title: 'Charts',
-    icon: 'chart'
-  },
-  children: [
-    {
-      path: 'keyboard',
-      component: () => import('@/views/charts/keyboard'),
-      name: 'KeyboardChart',
-      meta: { title: 'Keyboard Chart', noCache: true }
-    },
-    {
-      path: 'line',
-      component: () => import('@/views/charts/line'),
-      name: 'LineChart',
-      meta: { title: 'Line Chart', noCache: true }
-    },
-    {
-      path: 'mix-chart',
-      component: () => import('@/views/charts/mix-chart'),
-      name: 'MixChart',
-      meta: { title: 'Mix Chart', noCache: true }
-    }
-  ]
-}
-
-export default chartsRouter

+ 0 - 102
src/router/modules/components.js

@@ -1,102 +0,0 @@
-/** When your routing table is too long, you can split it into small modules **/
-
-import Layout from '@/layout'
-
-const componentsRouter = {
-  path: '/components',
-  component: Layout,
-  redirect: 'noRedirect',
-  name: 'ComponentDemo',
-  meta: {
-    title: 'Components',
-    icon: 'component'
-  },
-  children: [
-    {
-      path: 'tinymce',
-      component: () => import('@/views/components-demo/tinymce'),
-      name: 'TinymceDemo',
-      meta: { title: 'Tinymce' }
-    },
-    {
-      path: 'markdown',
-      component: () => import('@/views/components-demo/markdown'),
-      name: 'MarkdownDemo',
-      meta: { title: 'Markdown' }
-    },
-    {
-      path: 'json-editor',
-      component: () => import('@/views/components-demo/json-editor'),
-      name: 'JsonEditorDemo',
-      meta: { title: 'JSON Editor' }
-    },
-    {
-      path: 'split-pane',
-      component: () => import('@/views/components-demo/split-pane'),
-      name: 'SplitpaneDemo',
-      meta: { title: 'SplitPane' }
-    },
-    {
-      path: 'avatar-upload',
-      component: () => import('@/views/components-demo/avatar-upload'),
-      name: 'AvatarUploadDemo',
-      meta: { title: 'Upload' }
-    },
-    {
-      path: 'dropzone',
-      component: () => import('@/views/components-demo/dropzone'),
-      name: 'DropzoneDemo',
-      meta: { title: 'Dropzone' }
-    },
-    {
-      path: 'sticky',
-      component: () => import('@/views/components-demo/sticky'),
-      name: 'StickyDemo',
-      meta: { title: 'Sticky' }
-    },
-    {
-      path: 'count-to',
-      component: () => import('@/views/components-demo/count-to'),
-      name: 'CountToDemo',
-      meta: { title: 'Count To' }
-    },
-    {
-      path: 'mixin',
-      component: () => import('@/views/components-demo/mixin'),
-      name: 'ComponentMixinDemo',
-      meta: { title: 'Component Mixin' }
-    },
-    {
-      path: 'back-to-top',
-      component: () => import('@/views/components-demo/back-to-top'),
-      name: 'BackToTopDemo',
-      meta: { title: 'Back To Top' }
-    },
-    {
-      path: 'drag-dialog',
-      component: () => import('@/views/components-demo/drag-dialog'),
-      name: 'DragDialogDemo',
-      meta: { title: 'Drag Dialog' }
-    },
-    {
-      path: 'drag-select',
-      component: () => import('@/views/components-demo/drag-select'),
-      name: 'DragSelectDemo',
-      meta: { title: 'Drag Select' }
-    },
-    {
-      path: 'dnd-list',
-      component: () => import('@/views/components-demo/dnd-list'),
-      name: 'DndListDemo',
-      meta: { title: 'Dnd List' }
-    },
-    {
-      path: 'drag-kanban',
-      component: () => import('@/views/components-demo/drag-kanban'),
-      name: 'DragKanbanDemo',
-      meta: { title: 'Drag Kanban' }
-    }
-  ]
-}
-
-export default componentsRouter

+ 0 - 66
src/router/modules/nested.js

@@ -1,66 +0,0 @@
-/** When your routing table is too long, you can split it into small modules **/
-
-import Layout from '@/layout'
-
-const nestedRouter = {
-  path: '/nested',
-  component: Layout,
-  redirect: '/nested/menu1/menu1-1',
-  name: 'Nested',
-  meta: {
-    title: 'Nested Routes',
-    icon: 'nested'
-  },
-  children: [
-    {
-      path: 'menu1',
-      component: () => import('@/views/nested/menu1/index'), // Parent router-view
-      name: 'Menu1',
-      meta: { title: 'Menu 1' },
-      redirect: '/nested/menu1/menu1-1',
-      children: [
-        {
-          path: 'menu1-1',
-          component: () => import('@/views/nested/menu1/menu1-1'),
-          name: 'Menu1-1',
-          meta: { title: 'Menu 1-1' }
-        },
-        {
-          path: 'menu1-2',
-          component: () => import('@/views/nested/menu1/menu1-2'),
-          name: 'Menu1-2',
-          redirect: '/nested/menu1/menu1-2/menu1-2-1',
-          meta: { title: 'Menu 1-2' },
-          children: [
-            {
-              path: 'menu1-2-1',
-              component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
-              name: 'Menu1-2-1',
-              meta: { title: 'Menu 1-2-1' }
-            },
-            {
-              path: 'menu1-2-2',
-              component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
-              name: 'Menu1-2-2',
-              meta: { title: 'Menu 1-2-2' }
-            }
-          ]
-        },
-        {
-          path: 'menu1-3',
-          component: () => import('@/views/nested/menu1/menu1-3'),
-          name: 'Menu1-3',
-          meta: { title: 'Menu 1-3' }
-        }
-      ]
-    },
-    {
-      path: 'menu2',
-      name: 'Menu2',
-      component: () => import('@/views/nested/menu2/index'),
-      meta: { title: 'Menu 2' }
-    }
-  ]
-}
-
-export default nestedRouter

+ 90 - 0
src/router/modules/sys.js

@@ -0,0 +1,90 @@
+/** When your routing table is too long, you can split it into small modules **/
+
+import Layout from '@/layout'
+
+const sysRouter = {
+  path: '/sys',
+  component: Layout,
+  redirect: '/sys/menus',
+  alwaysShow: true, // will always show the root menu
+  name: 'SysSetting', // name必须和后台配置一致,不然匹配不到
+  meta: { title: '系统设置', icon: 'el-icon-s-tools' },
+  children: [
+    {
+      path: 'menus',
+      component: () => import('@/views/sys/menus/index'),
+      redirect: '/sys/menus/list',
+      name: 'SysMenus',
+      meta: { title: '菜单管理', icon: 'el-icon-menu' },
+      children: [
+        {
+          path: 'list',
+          hidden: true,
+          component: () => import('@/views/sys/menus/list.vue'),
+          name: 'SysMenus', // 隐藏的子菜单属性name可以用父级的
+          meta: { title: '菜单列表' }
+        },
+        {
+          path: 'form',
+          hidden: true,
+          component: () => import('@/views/sys/menus/form.vue'),
+          name: 'SysMenus',
+          meta: { title: '菜单编辑' }
+        }
+      ]
+    },
+    {
+      path: 'roles',
+      component: () => import('@/views/sys/roles/index'),
+      redirect: '/sys/roles/list',
+      name: 'SysRoles',
+      meta: { title: '角色管理', icon: 'lock' },
+      children: [
+        {
+          path: 'list',
+          hidden: true,
+          component: () => import('@/views/sys/roles/list.vue'),
+          name: 'SysRoles',
+          meta: { title: '角色列表' }
+        },
+        {
+          path: 'form',
+          hidden: true,
+          component: () => import('@/views/sys/roles/form.vue'),
+          name: 'SysRoles',
+          meta: { title: '添加角色' }
+        }
+      ]
+    },
+    {
+      path: 'users',
+      component: () => import('@/views/sys/users/index'),
+      redirect: '/sys/users/list',
+      name: 'SysUsers',
+      meta: { title: '用户管理', icon: 'user' },
+      children: [
+        {
+          path: 'list',
+          hidden: true,
+          component: () => import('@/views/sys/users/list.vue'),
+          name: 'SysUsers',
+          meta: { title: '角色列表' }
+        },
+        {
+          path: 'form',
+          hidden: true,
+          component: () => import('@/views/sys/users/form.vue'),
+          name: 'SysUsers',
+          meta: { title: '添加用户' }
+        }
+      ]
+    },
+    {
+      path: 'icons',
+      component: () => import('@/views/sys/icons/index'),
+      name: 'SysIcons',
+      meta: { title: '系统图标', icon: 'el-icon-picture', noCache: true }
+    }
+  ]
+}
+export default sysRouter

+ 0 - 41
src/router/modules/table.js

@@ -1,41 +0,0 @@
-/** When your routing table is too long, you can split it into small modules **/
-
-import Layout from '@/layout'
-
-const tableRouter = {
-  path: '/table',
-  component: Layout,
-  redirect: '/table/complex-table',
-  name: 'Table',
-  meta: {
-    title: 'Table',
-    icon: 'table'
-  },
-  children: [
-    {
-      path: 'dynamic-table',
-      component: () => import('@/views/table/dynamic-table/index'),
-      name: 'DynamicTable',
-      meta: { title: 'Dynamic Table' }
-    },
-    {
-      path: 'drag-table',
-      component: () => import('@/views/table/drag-table'),
-      name: 'DragTable',
-      meta: { title: 'Drag Table' }
-    },
-    {
-      path: 'inline-edit-table',
-      component: () => import('@/views/table/inline-edit-table'),
-      name: 'InlineEditTable',
-      meta: { title: 'Inline Edit' }
-    },
-    {
-      path: 'complex-table',
-      component: () => import('@/views/table/complex-table'),
-      name: 'ComplexTable',
-      meta: { title: 'Complex Table' }
-    }
-  ]
-}
-export default tableRouter

+ 21 - 0
src/router/modules/wechat.js

@@ -0,0 +1,21 @@
+/** When your routing table is too long, you can split it into small modules **/
+
+import Layout from '@/layout'
+
+const wechatRouter = {
+  path: '/wechat',
+  component: Layout,
+  redirect: '/wechat/icons',
+  alwaysShow: true, // will always show the root menu
+  name: 'WeChat', // name必须和后台配置一致,不然匹配不到
+  meta: { title: '微信后台', icon: 'el-icon-s-tools' },
+  children: [
+    {
+      path: 'icons',
+      component: () => import('@/views/sys/icons/index'),
+      name: 'SysIcons',
+      meta: { title: '系统图标', icon: 'el-icon-picture', noCache: true }
+    }
+  ]
+}
+export default wechatRouter

+ 1 - 1
src/views/login/index.vue

@@ -77,7 +77,7 @@
       }
       return {
         loginForm: {
-          username: 'test',
+          username: 'charles',
           password: '123456'
         },
         loginRules: {