diff --git a/src/assets/iconfont/iconfont.js b/src/assets/iconfont/iconfont.js index d988ec76..d397893d 100644 --- a/src/assets/iconfont/iconfont.js +++ b/src/assets/iconfont/iconfont.js @@ -14,6 +14,12 @@ '' + '' + '' + + '' + + '' + + '' + + '' + + '' + + '' + '' + '' + '' + diff --git a/src/components/Tinymce/components/editorImage.vue b/src/components/Tinymce/components/editorImage.vue index f9eef654..a4225746 100644 --- a/src/components/Tinymce/components/editorImage.vue +++ b/src/components/Tinymce/components/editorImage.vue @@ -5,14 +5,14 @@ + :on-success="handleImageScucess"> 点击上传 取 消 @@ -56,6 +56,9 @@ } } }, + handleImageScucess(file) { + this.list.push({ url: file.files.file }); + }, beforeUpload() { const _self = this; return new Promise((resolve, reject) => { diff --git a/src/components/Tinymce/index.vue b/src/components/Tinymce/index.vue index 7bacbde1..70cf4d18 100644 --- a/src/components/Tinymce/index.vue +++ b/src/components/Tinymce/index.vue @@ -100,47 +100,38 @@ this.$emit('input', editor.getContent({ format: 'raw' })); }); }, - images_dataimg_filter(img) { - setTimeout(() => { - const $image = $(img); - $image.removeAttr('width'); - $image.removeAttr('height'); - if ($image[0].height && $image[0].width) { - $image.attr('data-wscntype', 'image'); - $image.attr('data-wscnh', $image[0].height); - $image.attr('data-wscnw', $image[0].width); - $image.addClass('wscnph'); - } - }, 0); - return img - }, - images_upload_handler(blobInfo, success, failure, progress) { - progress(0); - const token = _this.$store.getters.token; - getToken(token).then(response => { - const url = response.data.qiniu_url; - const formData = new FormData(); - formData.append('token', response.data.qiniu_token); - formData.append('key', response.data.qiniu_key); - formData.append('file', blobInfo.blob(), url); - upload(formData).then(() => { - success(url); - progress(100); - // setTimeout(() => { - // const doc = tinymce.activeEditor.getDoc(); - // const $$ = tinymce.dom.DomQuery; - // const $image = $$(doc).find('img[src="' + url + '"]') - // $image.addClass('wscnph'); - // $image.attr('data-wscntype', 'image'); - // $image.attr('data-wscnh', $image[0].height || 640); - // $image.attr('data-wscnw', $image[0].width || 640); - // }, 0); - }) - }).catch(err => { - failure('出现未知问题,刷新页面,或者联系程序员') - console.log(err); - }); - }, + // images_dataimg_filter(img) { + // setTimeout(() => { + // const $image = $(img); + // $image.removeAttr('width'); + // $image.removeAttr('height'); + // if ($image[0].height && $image[0].width) { + // $image.attr('data-wscntype', 'image'); + // $image.attr('data-wscnh', $image[0].height); + // $image.attr('data-wscnw', $image[0].width); + // $image.addClass('wscnph'); + // } + // }, 0); + // return img + // }, + // images_upload_handler(blobInfo, success, failure, progress) { + // progress(0); + // const token = _this.$store.getters.token; + // getToken(token).then(response => { + // const url = response.data.qiniu_url; + // const formData = new FormData(); + // formData.append('token', response.data.qiniu_token); + // formData.append('key', response.data.qiniu_key); + // formData.append('file', blobInfo.blob(), url); + // upload(formData).then(() => { + // success(url); + // progress(100); + // }) + // }).catch(err => { + // failure('出现未知问题,刷新页面,或者联系程序员') + // console.log(err); + // }); + // }, setup(editor) { editor.addButton('h2', { title: '小标题', // tooltip text seen on mouseover diff --git a/src/components/Upload/singleImage.vue b/src/components/Upload/singleImage.vue index 0169b4f2..f4a0a546 100644 --- a/src/components/Upload/singleImage.vue +++ b/src/components/Upload/singleImage.vue @@ -6,8 +6,8 @@ drag :multiple="false" :show-file-list="false" - action="https://upload.qbox.me" - :before-upload="beforeUpload" + action="https://httpbin.org/post" + :on-success="handleImageScucess">
将文件拖到此处,或点击上传
diff --git a/src/components/Upload/singleImage2.vue b/src/components/Upload/singleImage2.vue index 3d3e11be..32b7dda3 100644 --- a/src/components/Upload/singleImage2.vue +++ b/src/components/Upload/singleImage2.vue @@ -6,8 +6,8 @@ drag :multiple="false" :show-file-list="false" - action="https://upload.qbox.me" - :before-upload="beforeUpload" + action="https://httpbin.org/post" + :on-success="handleImageScucess">
Drag或点击上传
diff --git a/src/components/Upload/singleImage3.vue b/src/components/Upload/singleImage3.vue index 7404accf..2a01d0e1 100644 --- a/src/components/Upload/singleImage3.vue +++ b/src/components/Upload/singleImage3.vue @@ -6,8 +6,8 @@ drag :multiple="false" :show-file-list="false" - action="https://upload.qbox.me" - :before-upload="beforeUpload" + action="https://httpbin.org/post" + :on-success="handleImageScucess">
将文件拖到此处,或点击上传
@@ -15,7 +15,7 @@
  全球 付费节目单 最热 经济
- +
@@ -23,7 +23,7 @@
- +
@@ -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 @@ + + +