-
+
@@ -57,8 +57,8 @@
emitInput(val) {
this.$emit('input', val);
},
- handleImageScucess() {
- this.emitInput(this.tempUrl)
+ handleImageScucess(file) {
+ this.emitInput(file.files.file)
},
beforeUpload() {
const _self = this;
diff --git a/src/main.js b/src/main.js
index 569706fa..396a5922 100644
--- a/src/main.js
+++ b/src/main.js
@@ -36,7 +36,6 @@ Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
});
-
function hasPermission(roles, permissionRoles) {
if (roles.indexOf('admin') >= 0) return true;
return roles.some(role => permissionRoles.indexOf(role) >= 0)
diff --git a/src/router/index.js b/src/router/index.js
index 305d12de..6c8e8540 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -54,6 +54,8 @@ const Table = resolve => require(['../views/example/table'], resolve);
const Form1 = resolve => require(['../views/example/form1'], resolve);
const Form2 = resolve => require(['../views/example/form2'], resolve);
+/* permission */
+const Permission = resolve => require(['../views/permission/index'], resolve);
/* admin*/
// const AdminCreateUser = resolve => require(['../views/admin/createUser'], resolve);
@@ -86,6 +88,19 @@ export default new Router({
{ path: 'dashboard', component: dashboard }
]
},
+
+ {
+ path: '/permission',
+ component: Layout,
+ redirect: '/permission/index',
+ name: '权限测试',
+ icon: 'quanxian',
+ meta: { role: ['admin'] },
+ noDropdown: true,
+ children: [
+ { path: 'index', component: Permission, name: '权限测试页', meta: { role: ['admin'] } }
+ ]
+ },
{
path: '/components',
component: Layout,
diff --git a/src/views/permission/index.vue b/src/views/permission/index.vue
new file mode 100644
index 00000000..a33540bb
--- /dev/null
+++ b/src/views/permission/index.vue
@@ -0,0 +1,31 @@
+
+
+
你的权限: {{roles}}
+ 切换权限:
+
+
+
+
+
+
+