- 开发者工具中正常使用,但是在手机端却无法使用,直接报错网络错误,返回信息也是有问题
function uploadFileTwo(img, token = '') { reading('show','上传中'); // 配置参数 const config = { uptoken_url: '/m/base/file/uptoken?type=image', domain: window.location.protocol + '//upload.qiniu.com/', max_file_size: '100mb', max_retries: 3, chunk_size: '5mb', filters: { mime_types: [ { title: 'Image files', extensions: 'jpg,gif,png,bmp,jpeg' } ] } }; var oData = new FormData(); oData.append('name', img.name); oData.append('chunk', '0'); oData.append('chunks', '1'); oData.append('key', 'app52qno_' + img.name); oData.append('token', token); oData.append("file", img); // console.log(oData) // $.MsgBox.Alert('温馨提示','图片上地址是' + config.domain); $.ajax({ url: config.domain, type: 'POST', data: oData, processData: false, contentType: false, headers: { 'Authorization': 'Bearer ' + token }, xhr: function() { var tmpAjaxXhr = $.ajaxSettings.xhr(); if (tmpAjaxXhr.upload) { tmpAjaxXhr.upload.addEventListener('progress', function(data) { if (data.lengthComputable) { var tmptotal = Math.floor(data['loaded'] / data['total'] * 100); if (tmptotal == 100) { $(".mask_bg .txt").text('处理中') } else { $(".mask_bg .txt").text('上传'+tmptotal+ '%') } } }, false) }; return tmpAjaxXhr }, success: function(res) { console.log('File uploaded successfully:', res); reading('hide'); // console.log(res) if(res.size){ res.path = 'http://slfz4v68k.hd-bkt.clouddn.com/' + res.key; serverImg= (res.path.indexOf('http') >= 0 ? res.path : '/Uploads/'+res.path) ; //https://res.cdn.yqh.com // imgCall(serverImg); // 隐藏手动拖拽 $("#img").attr("src",serverImg); newImgCreate(); }else{ $.MsgBox.Alert('温馨提示','图片上传失败,请稍后再试'); } // return res.path; }, error: function(res){ reading('hide'); $.MsgBox.Alert('温馨提示','网络错误,请稍后再试!'+ JSON.stringify(res)); } }); }
02-05 - 扫码后,二维码测试链接有参数, 换另一个参数则没有参数?
[图片] 配置规则如上 [图片] 这是第一个测试链接配置后的二维码,有参数带入进去,是正常可访问。 [图片] 这是第二个链接,换了一个cnum参数。 访问进去后,没有参数。 请问这是什么原因导致的问题?我该如何修改可以更换更多的二维码 都是可带参数进入?
2022-12-28