ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
~~~ var ajaxUploader = new AjaxUploader({ element:element.fileInput, url:"{:url('add')}", note: '提示:最多上传5个文件,超出默认前五个,支持格式为:doc、docx、pdf', allowFileTypes: ['jpg','png','gif','jpeg'],//允许上传文件类型,格式'*.pdf;*.doc;' allowFileSize: 1024*1024*5, //5M fileChangeHandler:fileChangeHandler, beforeHandler:beforeHandler, queueHandler:queueHandler, successHandler:successHandler, errorHandler:errorHandler }); ~~~ ~~~ function fileChangeHandler(ajaxUploader,ajaxList){ if(ajaxList.length>0){ }else{ } } ~~~ ``` function beforeHandler(ajaxId){ } ``` ``` function queueHandler(ajaxId,process){ if(process==100){ element.textInput.val( '[上传完毕] '+ element.textInput.val()); }else{ element.uploadProcess.text(process+'%'); } } ``` ``` function successHandler(ajaxId,data){ if(data.code==1){ }else{ msgError(addone_config.note); } } ``` ``` function errorHandler(ajaxId,data){ msgError("请检查你的网络设置!"); } ```