Authored by weiqingting

提交

@@ -161,9 +161,12 @@ edit.prototype={ @@ -161,9 +161,12 @@ edit.prototype={
161 // $(this).attr("value",response.data); 161 // $(this).attr("value",response.data);
162 // } 162 // }
163 // }); 163 // });
  164 + if(!that.option.bucket){
  165 + alert("bucket不存在");
  166 + }
164 $('input[type="file"]',that.el).ajaxfileupload({ 167 $('input[type="file"]',that.el).ajaxfileupload({
165 'action': '/ajax/upload', 168 'action': '/ajax/upload',
166 - 'params':{"userId":543883,"bucket":that.option.bucket||'smart',__type:"upload"}, 169 + 'params':{"userId":543883,"bucket":that.option.bucket,__type:"upload"},
167 'onComplete': function(response) { 170 'onComplete': function(response) {
168 if(response.status&&response.code==200){ 171 if(response.status&&response.code==200){
169 var _w=$(this).next().find('.fileinput-button-icon'); 172 var _w=$(this).next().find('.fileinput-button-icon');
@@ -18,6 +18,7 @@ $.fn.ajaxfileupload = function(options) { @@ -18,6 +18,7 @@ $.fn.ajaxfileupload = function(options) {
18 $.extend(settings, options); 18 $.extend(settings, options);
19 } 19 }
20 20
  21 +
21 return this.each(function() { 22 return this.each(function() {
22 var $element = $(this); 23 var $element = $(this);
23 if ($element.data('ajaxUploader-setup') === true) return; 24 if ($element.data('ajaxUploader-setup') === true) return;
@@ -27,6 +28,12 @@ $.fn.ajaxfileupload = function(options) { @@ -27,6 +28,12 @@ $.fn.ajaxfileupload = function(options) {
27 if (ext) { 28 if (ext) {
28 settings.valid_extensions = ext.split(','); 29 settings.valid_extensions = ext.split(',');
29 } 30 }
  31 + var bucket = $element.attr("bucket");
  32 + if(bucket){
  33 + settings.params.bucket=bucket;
  34 + }
  35 + console.log(settings.params);
  36 +
30 $element.change(function() { 37 $element.change(function() {
31 uploading_file = false; 38 uploading_file = false;
32 if (settings.submit_button == null) { 39 if (settings.submit_button == null) {
@@ -157,7 +157,7 @@ @@ -157,7 +157,7 @@
157 <!-- Mov avi rmvb mp4 --> 157 <!-- Mov avi rmvb mp4 -->
158 <div class="row"> 158 <div class="row">
159 <div id="upload-wrapper1" class="col-md-3"> 159 <div id="upload-wrapper1" class="col-md-3">
160 - <input id="videofile" name="videofile" type="file" extend="mp4,rmvb,avi,mov" class="btn btn-primary ml10" value="{attachUrl}"> 160 + <input id="videofile" name="videofile" type="file" bucket="goodsvideo" extend="mp4,rmvb,avi,mov" class="btn btn-primary ml10" value="{attachUrl}">
161 </div> 161 </div>
162 <div class="col-md-9"> 162 <div class="col-md-9">
163 <div class="row"> 163 <div class="row">