$(function(){
	var hostId = localStorage.hostId;
	
	initUpload = function(){
		if(hostId==undefined||hostId==''){
			layer.msg('您还未登陆！！',{icon: 5});
			return ;
		}
		var foldId=$("#foldId").val();
		if(foldId==''||foldId=='0'){
			layer.msg('未确认上传文件夹',{icon: 5});
			return ;
		}
		diyUpload = $('#uploadTab').diyUpload({// 产品图片上传管理
			url:HttpRest+'cmsfile/diyupload.shtml',
			contentType:"application/json",
			formData:{foldId:foldId,hostId:hostId},
			success:function( data ) {
				console.info( data );
			},
			error:function( err ) {
				console.info( err );	
			},
			buttonText : '选择文件',
		});
	};
	
	initUpload(); // 初始化上传组件

});