diff --git a/src/App.vue b/src/App.vue
index ac9c633..a04e14c 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -2,11 +2,25 @@
-
+
+
+
+
\ No newline at end of file
diff --git a/src/icons/svg/404.svg b/src/icons/svg/404.svg
new file mode 100644
index 0000000..6df5019
--- /dev/null
+++ b/src/icons/svg/404.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/bug.svg b/src/icons/svg/bug.svg
new file mode 100644
index 0000000..05a150d
--- /dev/null
+++ b/src/icons/svg/bug.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/chart.svg b/src/icons/svg/chart.svg
new file mode 100644
index 0000000..27728fb
--- /dev/null
+++ b/src/icons/svg/chart.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/clipboard.svg b/src/icons/svg/clipboard.svg
new file mode 100644
index 0000000..90923ff
--- /dev/null
+++ b/src/icons/svg/clipboard.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/component.svg b/src/icons/svg/component.svg
new file mode 100644
index 0000000..207ada3
--- /dev/null
+++ b/src/icons/svg/component.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/documentation.svg b/src/icons/svg/documentation.svg
new file mode 100644
index 0000000..7043122
--- /dev/null
+++ b/src/icons/svg/documentation.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/drag.svg b/src/icons/svg/drag.svg
new file mode 100644
index 0000000..4185d3c
--- /dev/null
+++ b/src/icons/svg/drag.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/edit.svg b/src/icons/svg/edit.svg
new file mode 100644
index 0000000..d26101f
--- /dev/null
+++ b/src/icons/svg/edit.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/education.svg b/src/icons/svg/education.svg
new file mode 100644
index 0000000..7bfb01d
--- /dev/null
+++ b/src/icons/svg/education.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/email.svg b/src/icons/svg/email.svg
new file mode 100644
index 0000000..74d25e2
--- /dev/null
+++ b/src/icons/svg/email.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/excel.svg b/src/icons/svg/excel.svg
new file mode 100644
index 0000000..74d97b8
--- /dev/null
+++ b/src/icons/svg/excel.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/exit-fullscreen.svg b/src/icons/svg/exit-fullscreen.svg
new file mode 100644
index 0000000..485c128
--- /dev/null
+++ b/src/icons/svg/exit-fullscreen.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/fullscreen.svg b/src/icons/svg/fullscreen.svg
new file mode 100644
index 0000000..0e86b6f
--- /dev/null
+++ b/src/icons/svg/fullscreen.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/guide.svg b/src/icons/svg/guide.svg
new file mode 100644
index 0000000..b271001
--- /dev/null
+++ b/src/icons/svg/guide.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/icon.svg b/src/icons/svg/icon.svg
new file mode 100644
index 0000000..82be8ee
--- /dev/null
+++ b/src/icons/svg/icon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/international.svg b/src/icons/svg/international.svg
new file mode 100644
index 0000000..e9b56ee
--- /dev/null
+++ b/src/icons/svg/international.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/language.svg b/src/icons/svg/language.svg
new file mode 100644
index 0000000..0082b57
--- /dev/null
+++ b/src/icons/svg/language.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/list.svg b/src/icons/svg/list.svg
new file mode 100644
index 0000000..20259ed
--- /dev/null
+++ b/src/icons/svg/list.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/lock.svg b/src/icons/svg/lock.svg
new file mode 100644
index 0000000..74fee54
--- /dev/null
+++ b/src/icons/svg/lock.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/message.svg b/src/icons/svg/message.svg
new file mode 100644
index 0000000..14ca817
--- /dev/null
+++ b/src/icons/svg/message.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/money.svg b/src/icons/svg/money.svg
new file mode 100644
index 0000000..c1580de
--- /dev/null
+++ b/src/icons/svg/money.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/pdf.svg b/src/icons/svg/pdf.svg
new file mode 100644
index 0000000..957aa0c
--- /dev/null
+++ b/src/icons/svg/pdf.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/people.svg b/src/icons/svg/people.svg
new file mode 100644
index 0000000..2bd54ae
--- /dev/null
+++ b/src/icons/svg/people.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/peoples.svg b/src/icons/svg/peoples.svg
new file mode 100644
index 0000000..aab852e
--- /dev/null
+++ b/src/icons/svg/peoples.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/qq.svg b/src/icons/svg/qq.svg
new file mode 100644
index 0000000..ee13d4e
--- /dev/null
+++ b/src/icons/svg/qq.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/search.svg b/src/icons/svg/search.svg
new file mode 100644
index 0000000..84233dd
--- /dev/null
+++ b/src/icons/svg/search.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/shopping.svg b/src/icons/svg/shopping.svg
new file mode 100644
index 0000000..87513e7
--- /dev/null
+++ b/src/icons/svg/shopping.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/size.svg b/src/icons/svg/size.svg
new file mode 100644
index 0000000..ddb25b8
--- /dev/null
+++ b/src/icons/svg/size.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/skill.svg b/src/icons/svg/skill.svg
new file mode 100644
index 0000000..a3b7312
--- /dev/null
+++ b/src/icons/svg/skill.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/star.svg b/src/icons/svg/star.svg
new file mode 100644
index 0000000..6cf86e6
--- /dev/null
+++ b/src/icons/svg/star.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/tab.svg b/src/icons/svg/tab.svg
new file mode 100644
index 0000000..b4b48e4
--- /dev/null
+++ b/src/icons/svg/tab.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/theme.svg b/src/icons/svg/theme.svg
new file mode 100644
index 0000000..5982a2f
--- /dev/null
+++ b/src/icons/svg/theme.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/tree-table.svg b/src/icons/svg/tree-table.svg
new file mode 100644
index 0000000..8aafdb8
--- /dev/null
+++ b/src/icons/svg/tree-table.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/wechat.svg b/src/icons/svg/wechat.svg
new file mode 100644
index 0000000..c586e55
--- /dev/null
+++ b/src/icons/svg/wechat.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/zip.svg b/src/icons/svg/zip.svg
new file mode 100644
index 0000000..f806fc4
--- /dev/null
+++ b/src/icons/svg/zip.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/router/index.js b/src/router/index.js
index 6ceafd0..5633f71 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -35,13 +35,11 @@ export const constantRoutes = [{
component: () => import('@/views/login/index'),
hidden: true
},
-
{
path: '/404',
component: () => import('@/views/404'),
hidden: true
},
-
{
path: '/',
component: Layout,
@@ -57,13 +55,13 @@ export const constantRoutes = [{
}]
},
{
- path: '/user',
+ path: '/user', //用户管理
component: Layout,
redirect: '/user/list',
name: 'user',
meta: {
title: '用户管理',
- icon: 'example'
+ icon: 'people'
},
children: [{
path: 'user',
@@ -71,35 +69,34 @@ export const constantRoutes = [{
component: () => import('@/views/table/index'),
meta: {
title: '用户列表',
- icon: 'table'
- }
- },
- {
- path: 'tree',
- name: 'Table',
- component: () => import('@/views/tree/index'),
- meta: {
- title: 'Tree',
- icon: 'tree'
+ icon: 'peoples'
}
}
+ // ,
+ // {
+ // path: 'tree',
+ // name: '',
+ // component: () => import('@/views/tree/index'),
+ // meta: {
+ // title: '权限控制',
+ // icon: 'lock'
+ // }
+ // }
]
},
{
- path: '/example',
+ path: '/shop',
component: Layout,
- redirect: '/example/table',
- name: 'Example',
meta: {
title: '商家管理',
- icon: 'example'
+ icon: 'shopping'
},
children: [{
- path: 'table',
- name: 'Table',
+ path: 'shop',
+ name: 'Shop',
component: () => import('@/views/table/index'),
meta: {
- title: 'Table',
+ title: '商家列表',
icon: 'table'
}
},
@@ -108,49 +105,82 @@ export const constantRoutes = [{
name: 'Tree',
component: () => import('@/views/tree/index'),
meta: {
- title: 'Tree',
- icon: 'tree'
+ title: '图片分析',
+ icon: 'chart'
}
}
]
},
{
- path: '/example',
+ path: '/prod',
component: Layout,
- redirect: '/example/table',
- name: 'Example',
+ redirect: '/prod/table',
+ name: 'Prod',
meta: {
title: '产品管理',
- icon: 'example'
+ icon: 'tree'
},
children: [{
path: 'table',
- name: 'Table',
- component: () => import('@/views/table/index'),
+ name: 'Tree',
meta: {
- title: 'Table',
- icon: 'table'
- }
+ title: '成镜',
+ icon: 'tree-table'
+ },
+ children: [{
+ path: 'table',
+ name: 'tree',
+ component: () => import('@/views/tree/index'),
+ meta: {
+ title: '款式索引',
+ icon: 'tree-table'
+ },
+ children: [{
+ path: 'table',
+ name: 'Table1',
+ component: () => import('@/views/table/index'),
+ meta: {
+ title: '青春学子风',
+ icon: 'guide'
+ }
+ },{
+ path: 'table',
+ name: 'Table1',
+ component: () => import('@/views/table/index'),
+ meta: {
+ title: '质感哥特风',
+ icon: 'guide'
+ }
+ }]
+ },{
+ path: 'table',
+ name: 'tree',
+ component: () => import('@/views/table/index'),
+ meta: {
+ title: '颜色索引',
+ icon: 'tree-table'
+ }
+ }]
},
{
path: 'tree',
name: 'Tree',
- component: () => import('@/views/tree/index'),
+ component: () => import('@/views/table/index'),
meta: {
- title: 'Tree',
- icon: 'tree'
+ title: '镜片',
+ icon: 'tree-table'
}
}
]
},
{
- path: '/example',
+ path: '/Meta',
component: Layout,
- redirect: '/example/table',
- name: 'Example',
+ redirect: '/meta/table',
+ name: 'Meta',
meta: {
title: '元管理',
- icon: 'example'
+ icon: 'guide'
},
children: [{
path: 'table',
@@ -173,20 +203,20 @@ export const constantRoutes = [{
]
},
{
- path: '/example',
+ path: '/trade',
component: Layout,
redirect: '/example/table',
- name: 'Example',
+ name: 'Trade',
meta: {
title: '交易管理',
- icon: 'example'
+ icon: 'money'
},
children: [{
path: 'table',
name: 'Table',
component: () => import('@/views/table/index'),
meta: {
- title: 'Table',
+ title: '成交清单',
icon: 'table'
}
},
@@ -195,39 +225,29 @@ export const constantRoutes = [{
name: 'Tree',
component: () => import('@/views/tree/index'),
meta: {
- title: 'Tree',
- icon: 'tree'
+ title: '未成交清单',
+ icon: 'table'
}
}
]
}, {
- path: '/example',
+ path: '/recommand',
component: Layout,
- redirect: '/example/table',
- name: 'Example',
+ redirect: '/recommand/table',
+ name: 'Recommand',
meta: {
title: '推荐系统',
- icon: 'example'
+ icon: 'size'
},
children: [{
- path: 'table',
- name: 'Table',
- component: () => import('@/views/table/index'),
- meta: {
- title: 'Table',
- icon: 'table'
- }
- },
- {
- path: 'tree',
- name: 'Tree',
- component: () => import('@/views/tree/index'),
- meta: {
- title: 'Tree',
- icon: 'tree'
- }
+ path: 'table',
+ name: 'Table',
+ component: () => import('@/views/table/index'),
+ meta: {
+ title: '推荐系统教学',
+ icon: 'table'
}
- ]
+ }]
}, {
path: '/system',
component: Layout,
@@ -235,60 +255,60 @@ export const constantRoutes = [{
name: 'System',
meta: {
title: '系统设置',
- icon: 'example'
+ icon: 'component'
},
children: [{
- path: 'table',
- name: 'Table',
+ path: 'hangye_seting',
+ name: 'Hangye',
component: () => import('@/views/table/index'),
meta: {
title: '行业设置',
- icon: 'table'
+ icon: 'guide'
}
},
{
- path: 'tree',
- name: 'Tree',
+ path: 'language_seting',
+ name: 'Language',
component: () => import('@/views/tree/index'),
meta: {
title: '语言设置',
- icon: 'tree'
+ icon: 'language'
}
},
{
- path: 'tree',
- name: 'Tree',
+ path: 'money_seting',
+ name: 'Money',
component: () => import('@/views/tree/index'),
meta: {
title: '货币设置',
- icon: 'tree'
+ icon: 'money'
}
},
{
- path: 'tree',
- name: 'Tree',
+ path: 'site_seting',
+ name: 'Site',
component: () => import('@/views/tree/index'),
meta: {
title: '站点类型设置',
- icon: 'tree'
+ icon: 'form'
}
},
{
- path: 'tree',
- name: 'Tree',
+ path: 'template_seting',
+ name: 'Template',
component: () => import('@/views/tree/index'),
meta: {
title: '模版设置',
- icon: 'tree'
+ icon: 'theme'
}
},
{
- path: 'tree',
- name: 'Tree',
+ path: 'power_seting',
+ name: 'Power',
component: () => import('@/views/tree/index'),
meta: {
title: '权限设置',
- icon: 'tree'
+ icon: 'password'
}
}
]
diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js
index aeb5ee5..712a607 100644
--- a/src/store/modules/permission.js
+++ b/src/store/modules/permission.js
@@ -20,7 +20,6 @@ function hasPermission(roles, route) {
*/
export function filterAsyncRoutes(routes, roles) {
const res = []
-
routes.forEach(route => {
const tmp = { ...route }
if (hasPermission(roles, tmp)) {
@@ -45,15 +44,17 @@ const mutations = {
state.routes = constantRoutes.concat(routes)
}
}
-
+//根据动作进行判断
const actions = {
generateRoutes({ commit }, roles) {
return new Promise(resolve => {
let accessedRoutes
if (roles.includes('admin')) {
+ console.log('------------generateRoutes----asyncRoutes-----------', asyncRoutes, roles);
accessedRoutes = asyncRoutes || []
} else {
accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
+ accessedRoutes.push({});
}
commit('SET_ROUTES', accessedRoutes)
resolve(accessedRoutes)
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 255e04f..684d278 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -57,7 +57,10 @@ const actions = {
}).then(response => {
console.log('返回的数据-- step 3------>', response);
// const { token, name, id, password } = response
- const {token,name} = response
+ const {
+ token,
+ name
+ } = response
console.log('返回的数据-- step 4------>', response);
commit('SET_TOKEN', token)
setToken(token)
@@ -78,7 +81,14 @@ const actions = {
getInfo(state.token).then(response => {
console.log('返回的数据-- step 5------>', state);
console.log('返回的数据-- step 5.1------>', response);
- const {avatar,id,name,password,roles,token} = response
+ const {
+ avatar,
+ id,
+ name,
+ password,
+ roles,
+ token
+ } = response
if (!roles) {
reject('Verification failed, please Login again.')
}
diff --git a/src/views/table/index.vue b/src/views/table/index.vue
index 14c3779..b419cb9 100644
--- a/src/views/table/index.vue
+++ b/src/views/table/index.vue
@@ -84,7 +84,7 @@ export default {
this.listLoading = true;
getList().then(response => {
console.log("----getList---", response);
- this.list = response.data.items;
+ this.list = response.items;
this.listLoading = false;
});
}