网站表单里面 图片专用字段出现错误

迅睿框架 更新 2024-12-08 01:39:24 大白菜慢慢学

网站表单里面 图片专用字段,从系统自带模块代码复制出来,自定义了个模板放进去后出现;

1733564940308

代码如下:


<script type="text/javascript">$(function(){$("#my-dropzone-baomingzhao").sortable();Dropzone.autoDiscover=false;$("#my-dropzone-baomingzhao").dropzone({addRemoveLinks:true,maxFiles:99999,maxFilesize:5,acceptedFiles:"image/*",dictMaxFilesExceeded:"最多只能上传1张图片(可在自定义字段中设置本字段的个数值)",dictResponseError:'文件上传失败',dictInvalidFileType:"不能上传该类型文件",dictFallbackMessage:"浏览器不受支持",dictFileTooBig:"文件过大上传文件最大支持",url:"/index.php?s=api&c=file&token=7ddf5a9f31b65823455d4c30b8a1510a&siteid=1&m=upload&p=5b009e0196ca677a4370d1beee32d2ac&fid=76",init:function(){this.on("addedfile",function(file){var activeFiles=this.getActiveFiles();var num=parseInt($(".dr_dropzone_baomingzhao_total").val());if(num+activeFiles.length+1>1){this.options.maxFiles=-1}});this.on("success",function(file,res){var rt=JSON.parse(res);if(rt.code){var num=parseInt($(".dr_dropzone_baomingzhao_total").val());$(".dr_dropzone_baomingzhao_total").val(num+1);var input='<input class="dr_dropzone_baomingzhao" type="hidden" name="data[baomingzhao][]" value="'+rt.id+'" />';$(file.previewElement).append(input)}else{dr_tips(0,rt.msg);file.previewElement.classList.remove("dz-success");file.previewElement.classList.add("dz-error");file.previewElement.classList.add("dz-error")}})}});$("#my-dropzone-baomingzhao").append("<input class=\"dr_dropzone_baomingzhao_total\" type=\"hidden\" value=\"0\" />")});function dr_delete_image_baomingzhao(e){var num=parseInt($(".dr_dropzone_baomingzhao_total").val());$(".dr_dropzone_baomingzhao_total").val(num-1);$("#image-baomingzhao-"+e).remove()}</script>

<audio controls="controls" style="display: none;"></audio>

方案

  • 平淡人生 #1 · 2024-12-07 21:29:11
    满意答案
    ){$("改成 ){ 空格 $("
  • 大白菜慢慢学 #2 · 2024-12-08 01:39:24
    @平淡人生:,成功解决了问题

迅睿系统漏洞

站群分站系统
站群分站系统(2026-10-15)
子站域名新增llms.txt访问
GEO系统
GEO系统(2026-10-14)
修复下载zip空白地址问题 修复流量复刻和任务队列错误
GeoSeo收录宝
GeoSeo收录宝(2026-10-14)
新增 站长工具箱 前端首页自动调用meta 数据
滑块验证码 Gocaptcha
滑块验证码 Gocaptcha(2026-10-13)
基于开源项目 go-captcha 的行为验证码插件,滑动拼图、区域...
GeoSeo工具箱
GeoSeo工具箱(2026-10-13)
优化巡检任务
GeoSeo排名助手
GeoSeo排名助手(2026-10-11)
加入大模型自定义
SEO聚合关键字
SEO聚合关键字(2026-10-11)
优化关键字列表页最多支持1万篇文章,过多会导致服务器扛不住;
CMS内容同步复制
CMS内容同步复制(2026-10-10)
增加时间是否更新的开关