Summernote image upload

Summernote image upload

onImageUpload: function(files, editor, $editable) {
  messageCenterUploadTokenModule.query(function(d){
    var formData = new FormData();
    formData.append('file', files[0]);
    tools.block.blockUI({target: '#'+$scope.modalId});
    formData.append('token', d.token);
    tools.uploadRequest('', formData).then(function(d) {
    editor.insertImage($editable,"http://dhcrestmsg.dhero.cn/"+d.key);
    tools.block.unblockUI();
    tools.notification.success('上传图片成功');
  }, function() {
    tools.notification.error('上传图片失败');
  })
  });
}

posted @ 2015-07-16 10:32  mingying  阅读(1321)  评论(0编辑  收藏  举报