c# 后台接收formdata对象 enctype="multipart/form-data"提交

这是一个文件上传功能。
c#后台如何接收<input name="upload"
我需要获取这个控件选择的文件的路径
前端

     <form id="form1" enctype="multipart/form-data" >
    <div>
    <input name="upLoad" type="file" id="upLoad" />
    <button id="btnUpLoad">上传</button>
    <button id="btnDownLoad" >下载</button>
    </div>
    </form>

js

$(document).ready(function () {
    $("#btnUpLoad").click(function () {
        $.ajax({
            url: "Handler3.ashx",
            type: "POST",
            data: new FormData($("#form1")[0]),
            cache: false,
            processData: false,
            contentType: false,
            success: function () {
            },
            error: function () {
            }
        });
        return false;
    })

}) 

4个回答

不要用jquery.ajax,不支持传递FormData对象,使用jquery.form.js这个插件,会自动帮你传送文件

http://plugins.jquery.com/form/

或者直接用XMLHttpRequest发送FormData对象:html5 ajax上传文件asp.net示例

获取数据和普通表单提交的一样

dwa4821
dwa4821 代码在下面
3 年多之前 回复
dwa4821
dwa4821 我想用分块方式上传,要怎么做
3 年多之前 回复
 //上传文件地址
                string URLAddress = upLoad2.FileName;
                //上传文件存放位置
                string receivePath = context.Server.MapPath("~/");
                //从上传地址创建一个可读流
                Stream str = client.OpenRead(URLAddress);
                //实例化以特定编码读取文件的读取器
                StreamReader reader = new StreamReader(str);


                while (allmybyte > 0)
                {
                    //m:读入缓冲区的总字节数
                    //从当前流的startmbyte位置,欲读取allmybyte字节,放入byte数组
                    int m = str.Read(mbyte, startmbyte, allmybyte);
                    if (m == 0)
                        break;
                    //读取起始位置加m
                    startmbyte += m;
                    //要读取的字节数减少m
                    allmybyte -= m;
                }
                //释放流读取器资源
                reader.Dispose();
                //释放流资源
                str.Dispose();
                //文件上传下来存放的路径
                string path = receivePath + System.IO.Path.GetFileName(URLAddress);
                //实例化文件操作类。设置文件的路径,打开方式,读写权限
                FileStream fstr = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);
                //往文件流里写入字节
                fstr.Write(mbyte, 0, startmbyte);
                //清除此流的缓冲区,使得所有缓冲的数据都写入到文件中
                fstr.Flush();
                //关闭当前流并释放与之关联的所有资源
                fstr.Close();
 HttpPostedFile upLoad2 = context.Request.Files["upLoad"];

            //文件操作类型,上传还是下载
            string title = context.Request.Form["title"];

            HttpPostedFile upFile = HttpContext.Current.Request.Files["upLoad"];

            //提供用于将数据发送到和接收来自通过 URI 确认的资源数据的常用方法
                WebClient client = new WebClient();

                 //分配10000000字节给mbyte
                byte[] mbyte = new byte[1000000];
                //数组长度
                int allmybyte = (int)mbyte.Length;
                int startmbyte = 0;
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
c# 后台接收 ajax formdata对象
怎么接受ajax传来的formdata对象 ``` $(document).ready(function () { var formData = new FormData("#form1"); $.ajax({ url: "Handler3.ashx", type: "POST", data: formData, async: true, cache: false, processData: false, success: function () { }, error:function(){ } }); }) ```
后台如何获取上传文件,急,web方面一点都不懂但工作需要,望回答详细点,谢谢
第一、cshtml文件代码: class="easyui-window" id="import-excel-template" title="文件上传" style="width:500px;height:150px;padding:2px;" closed="true"> 《Form id="importFileForm" method="post" enctype="multipart/form-data" style="display:none"> 《 table style="margin:5px;height:70px;"> 《tr> 《td>《input type="file" class="easyui-filebox" id="fileImport" name="fileImport" style="width:400px;" onchange="document.getElementById('textfield').value=this.value"></td> 《td></td> 《/tr> 《tr> 《td colspan="4">《label id="fileName" /></td> 《/tr> 《tr> 《td colspan="4"> 《label id="uploadInfo" /> </td> 《/tr> 《/table> 《input type="text" name="textfield" class="file" id="textfield" 《div style="text-align:center;clear:both;margin:5px;"> 《a id="uploadFile2" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" data-bind="click:importFileClick" href="javascript:void(0)">上传</a> 《a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" data-bind="click:closeImportClick" href="javascript:void(0)">关闭</a> 《/div> 《/form> 《/div> 第二、js代码 //获取form数据 var formData = new FormData($("#importFileForm")[0]); var strUrl = '/api/sys/ProductVersion/PostExcelData?' + 'VersionCode=' + escape(mUploadVersion);//关键 escape编码后台直接读出的是中文 //调用apicontroller后台action方法,将form数据传递给后台处理。contentType必须设置为"multipart/form-data" $.ajax({ url: strUrl, type: 'POST', //上传文件则此属性是必须的,但得出VersionCode为乱码;若不是上传文件不要此属性VersionCode不是乱码 data: formData, //{"":"avvvv"}, //与此属性无关Request.Files async: false, cache: false, contentType: "multipart/form-data", //必须false才会自动加上正确的Content-Type processData: false, //必须false才会避开jQuery对 formdata 的默认处理 success: function (returnInfo) { //上传成功后将控件内容清空,并显示上传成功信息 document.getElementById('fileImport').value = null; document.getElementById('uploadInfo').innerHTML = "<span style='color:Red'>" + returnInfo + "</span>"; mbHasUpload = true; }, error: function (returnInfo) { //上传失败时显示上传失败信息 document.getElementById('uploadInfo').innerHTML = "<span style='color:Red'>" + returnInfo + "</span>"; } }); 第三、public class ProductVersionApiController : ApiController里面的方法PostExcelData() //todo 获取客户端上传的文件集合, ie11可以,360-火狐-google chromse不行 HttpFileCollection files = System.Web.HttpContext.Current.Request.Files; **问题:Request.Files里面得到的是文件的路径而且除了ie其他浏览器时个数都是0,这个方法不实用。如果能得到文件字节流最好了。 不过无论什么方法,能解决我的问题就行**
java后台解决跨域访问,为什么前端还不能访问上传文件
``` function upload() { var form1 = document.createElement("form"); form1.setAttribute("id","form1"); document.body.appendChild(form1) var inputObj=document.createElement('input') inputObj.setAttribute('id','file'); inputObj.setAttribute('type','file'); inputObj.setAttribute('name','file'); inputObj.setAttribute("style",'visibility:hidden'); inputObj.click() form1.appendChild(inputObj) inputObj.onchange = function () { form1.method ="POST"; form1.enctype = "multipart/form-data"; $("#form1").submit(function () { var formData = new FormData(); formData.append("file",$("#file")[0]); $.ajax({ url:"http://localhost:8080/file/upload.action", type:"POST", contentType:"multipart/form-data", data:formData, cache:false, processData:false, success:function (data) { console.log(data) } }) }) } } ``` 如上代码,html为了美观只用了一个button,button点击后调用这个函数,然后用js创建form表单和input,这里问题来了:如果单单表单提交,没有问题,但是会跳转页面;如果单单用ajax,出现跨域(服务器端已经添加了header还是会有跨域问题), 再就是使用如上的代码,form表单中使用ajax请求,没有出现任何问题并且文件没有上传,好像是 $("#form1").submit(function () )没有调用,小白求解。
多个input 怎么上传多个图片,用ajax发送,后台用springmvc接收
<form enctype="multipart/form-data"method="POST"> Send thisfile1: <input name="file1"type="file"/> Send thisfile2: <input name="file2"type="file"/> Send thisfile3: <input name="file3"type="file"/> <input type="submit"value="Send File"/></form> --------------------------------------------------------------- var formData = new FormData(); formData.append('file', $('#file1')[0].files[0]); formData.append('file', $('#file2')[0].files[0]); formData.append('file', $('#file3')[0].files[0]); formData.append("fname",fname); formData.append("fprice",fprice); formData.append("fdetail",fdetail); formData.append("meterial",meterial); $.ajax({ url : "./insert", type : "POST", data :formData, async : true, cache : false, contentType : false, processData : false, success : function(data) { if(data=="success"){ alert("添加成功!") window.location.href="#" }else{ alert("添加失败!") } } }); 请问后台springmvc的controller怎么接收,我试了好就都不行。
JS点击按钮弹出文件选择框选择文件怎么做其他的操作,就单个按钮控件实现
button: ``` <button class="btn btn-primary" onclick="upload()">上传 <span class="glyphicon glyphicon-open"></span></button> ``` upload函数: ``` function upload() { var inputObj=document.createElement('input') inputObj.setAttribute('id','file'); inputObj.setAttribute('type','file'); inputObj.setAttribute('name','file'); inputObj.setAttribute("style",'visibility:hidden'); document.body.appendChild(inputObj); inputObj.value; inputObj.click(); console.log(inputObj) // var formdata = new FormData($("#file")[0]); // $.ajax({ // url:"http://localhost:8080/file/upload.action", // type:"POST", // data:formdata, // enctype:"multipart/form-data", // contentType:false, // processData:false, // success:function (data) { // console.log(data) // } // }) } ``` 这里打开只能出现文件选择框: ![图片说明](https://img-ask.csdn.net/upload/201803/29/1522305978_662316.png) 怎么在upload函数中继续做ajax请求,照上面那函数还没选文件就发出请求了
jquery根据id获取input文本框中输入的值为undefined
html代码 ``` <div class="form-group"> <label for="exampleInputName2">单据编号:</label> <input type="text" class="form-control" id="yield_code" placeholder=""> </div> ``` js代码 ``` //获取单据编号 .attr("value") var yieldCode=$("#yield_code").val(); ``` 这是完整的js ``` $("#btnImport").on("click", function(){ var formData = new FormData(); formData.append("file",$('#exampleInputFile')[0].files[0]);//封装文件 //获取单据编号 .attr("value") var yieldCode=$("#yield_code").val(); //获取核算期间 var yieldDate=$("#yieldDate").val(); //获取审核人 var auditor=$("#auditor").val(); //获取审核时间 var auditDate=$("#auditDate").val(); formData.append("yieldCode",yieldCode);//封装单据编号 formData.append("yieldDate",yieldDate);//封装核算区间 formData.append("auditor",auditor);//封装审核人 formData.append("auditDate",auditDate);//封装审核时间 alert(yieldCode); alert(yieldDate); alert(auditor); alert(auditDate); }) ``` 这是部分html代码 ``` <form class="" method="post" enctype="multipart/form-data"> <div class="form-head" style="display: flex; justify-content: space-around"> <div class="form-group"> <label for="exampleInputName2">单据编号:</label> <input type="text" class="form-control" value="aa"  id="yield_code" placeholder=""> </div> <div class="form-group"> <label for="exampleInputEmail2">核算期间:</label><input type="date" class="form-control" id="yieldDate" placeholder=""> </div> <!--<div class="layui-upload layui-inline layui-show-xs-block">--> <!--<button type="button" class="layui-btn layui-btn-normal" id="btnSelectFile">选择Excel</button>--> <!--<button type="button" class="layui-btn" id="btnImport">开始导入</button>--> <!--</div>--> <div class="form-main"> <div class="form-group" style="margin-bottom: 0"> <input type="file" id="exampleInputFile" name="file" value="" style="width: 180px; margin-bottom: 2px"> <span class="span" style="color: red;font-size: 14px;"> *必须指定 Excel文件! </span> </div> <div class="form-group" style="margin-bottom: 2px;"> <button type="button" id="btnImport">开始导入</button> </div> </div> </div> </form> ```
SpringMVC+ajax上传文件+提交表单数据报错The current request is not a multipart request
AJAX var commercialName=$("#commercialName").val() var commerciaPhone=$("#commerciaPhone").val() var commerciaSite=$("#commerciaSite").val() console.log(commercialName) var file=document.getElementById('file').files var formData=new FormData() formData.append("file",file[0]) $.ajax({"url":"/systemController/merchantController/contact", "encType": 'multipart/form-data', "processData": false, "contentType":false, "data":{"file":formData,"commercialName":commercialName,"commerciaPhone":commerciaPhone, "commerciaSite":commerciaSite}, "type":"post", "dataType":"json", "success":... ``` JAVA ``` @RequestMapping(value = "contact" ,method = RequestMethod.POST) @ResponseBody public Dto contact( MultipartFile file, DbBusinessInformation businessInformation, HttpServletRequest request) ``` ``` 也找了很多方法,还是没办法解决
jquery ajax 上传文件 后台取不到file
正在做一个文件上传的程序,在上传之前需要验证文件的大小,不能超过10M,我采用的是jquery ajax的方式提交到后台Action,由后台Action判断文件大小。 首先看jsp页面: <form name="upload" method="post" enctype="multipart/form-data" action="publish/publish_upload.action" > <span> <s:text name="publish.content"/> <input type="file" name="file" id="uploadfile" onchange="checkFileSize()"> <font size="2" id="xx" color="blue" style="margin-left:30px; ">上传的文件不得大于10M</font> 。。。。省略部分.... </form> javascript代码: function checkFileSize() { var uploadfile = jq("#uploadfile"); var returnval = false; if(uploadfile.val()==""){ alert("请选择需要上传的文件"); return false; } var formData = new FormData(); formData.append("userfile",jq("#uploadfile")); var url = "ajax/ajax_checkFileSize.action"; jq.ajax({ type: "POST", url: url, async: false, enctype: 'multipart/form-data', data: formData, cache: false, contentType: false, processData: false, success: function (msg) { if(msg=="0"){ jq("#checkfile").text(""); alert("上传文件"+uploadfile.val()+"大于10M"); returnval = false; }else{ jq("#checkfile").text("文件可以上传"); jq("#checkfile").reset(); returnval = true; } } }); return returnval; } ajax后台判断也很简单: public String checkFileSize() throws IOException{ out = response.getWriter(); String message=""; try { response.setCharacterEncoding("utf-8"); double size = (double)file.length()/1048576; if(size>10){ message = "0"; }else{ message = "1"; } } catch (Exception e) { e.printStackTrace(); message="0"; }finally{ out.write(message); out.flush(); out.close(); } return null; } 但是每次都在double size = (double)file.length()/1048576;这里报空指针异常 请大家帮忙看看!
Easyui 使用dialog窗口提交form表单 数据为空
我点击打开easyUI的dialog窗口时,后台接收的数据全部为null;但我直接使用jq的打开窗口并传输数据,后台都能获取到。我看网上有人说使用了dialog文档结构改变了,找不到对应的from?该怎么改啊 * js部分 ```javascript <script type="text/javascript"> /* 显示addDiv */ function addDiv() { $("#addTab").dialog({ title : '新增', width : 600, height : 400, modal : true }) $("#addTab").dialog("open"); } /* 提交新增 */ function add() { var $dialog = $("#addDiv"); var $form = $dialog.find("form[name=addForm]"); var formData = new FormData($form[0]); console.log($form); console.log(formData); $.ajax({ url : basePath + "/goodsAdd.json", type : "post", dataType : "json", data :formData, processData : false, cache : false, contentType : false, success : function(data) { if (data.num == 1) { $.messager.alert('提示', "新增成功"); $("#datag").datagrid("reload"); } else { $.messager.alert('提示', "新增失败"); } } }); } </script> ``` * HTML部分 ```html <body> <div id="addDiv" > <form name="addForm" method="post" enctype="multipart/form-data"> <table id="addTab"> <tr> <td>商品名称:<input id="goodsname1" class="easyui-textbox" name="goodsname" style="width: 150px"></td> <td>商品价格:<input id="goodsprice1" class="easyui-numberbox" name="goodsprice" data-options="validType:'goodsprice',required:true" style="width: 150px"></td> </tr> <tr> <td>保质&emsp;期:<input id="releasedate1" class="easyui-numberbox" name="releasedate" data-options="validType:'releasedate',required:true" style="width: 150px"></td> <td>生产日期:<input id="creationdate1" class="easyui-datetimebox" name="creationdate" data-options="validType:'creationdate',required:true" style="width: 150px"></td> </tr> <tr> <td>产&emsp;&emsp;地:<input id="producingarea1" class="easyui-textbox" name="producingarea" data-options="validType:'producingarea',required:true" style="width: 150px"></td> <td>商品类型:<input id="goodstype1" class="easyui-textbox" name="goodstype" data-options="validType:'goodstype',required:true" style="width: 150px"></td> </tr> <tr> <td>商品信息:<input id="goodsinfo1" class="easyui-textbox" name="goodsinfo" data-options="validType:'goodsinfo',required:true" style="width: 150px"></td> </tr> <tr> <td colspan="2"> <div style="width: 100%; text-align: center;"> <img id="defaultImage" style="width: 250px; height: 150px; display: inline-block;" alt="默认商品" src="../../view/images/goods/wallhaven-2e3839.jpg"> </div> </td> </tr> <tr> <td colspan="2"> <div style="width: 100%; text-align: center;"> <input name="upImage" class="easyui-filebox" style="width: 300px" data-options="buttonText:'选择文件',onChange:showImage"> </div> </td> <td> <input type="hidden" id="goodsimagename" name="goodsimagename" value="wallhaven-2e3839"> <input type="hidden" id="goodssuffix" name="goodssuffix" value="jpg"> <input type="hidden" id="goodsimagetype" name="goodsimagetype" value="image/jpg"> <input type="hidden" id="goodsimagesize" name="goodsimagesize" value="8888"></td> </tr> <tr> <td colspan="2" style="text-align: center;"><a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',onClick:add">提交</a></td> </tr> </table> </form> </div> </body> ```
求助:html只能在微信浏览器打开,调用微信接口问题?
大家好 ,新手请教两个个问题 1.网页上输入域名的时候 直接访问了public目录下面的index.html 没有访问index.php 这个是tp模块默认的设置么? 2.这个怎么设置的index.html只能在微信端打开,我应该怎么解除,让他在普通浏览器也能正常打开呢? 个人觉得原因:1.它直接通过index.html里的js调用了微信授权,需要把js里的微信授权取消。但是我没能找到js里微信授权在哪里。 下么是图片: ![图片说明](https://img-ask.csdn.net/upload/202003/22/1584857161_740465.jpg) ![图片说明](https://img-ask.csdn.net/upload/202003/22/1584856909_155952.png) 下么是其中一个js代码: 1.index.5d79cff.js ``` (function(e){function n(n){for(var a,i,s=n[0],u=n[1],c=n[2],l=0,d=[];l<s.length;l++)i=s[l],o[i]&&d.push(o[i][0]),o[i]=0;for(a in u)Object.prototype.hasOwnProperty.call(u,a)&&(e[a]=u[a]);g&&g(n);while(d.length)d.shift()();return r.push.apply(r,c||[]),t()}function t(){for(var e,n=0;n<r.length;n++){for(var t=r[n],a=!0,i=1;i<t.length;i++){var u=t[i];0!==o[u]&&(a=!1)}a&&(r.splice(n--,1),e=s(s.s=t[0]))}return e}var a={},o={index:0},r=[];function i(e){return s.p+"static/js/"+({"pages-aboutUs-aboutUs":"pages-aboutUs-aboutUs","pages-buyLesson-buyLesson":"pages-buyLesson-buyLesson","pages-cargoDetail-cargoDetail~pages-questionDetail-questionDetail":"pages-cargoDetail-cargoDetail~pages-questionDetail-questionDetail","pages-cargoDetail-cargoDetail":"pages-cargoDetail-cargoDetail","pages-questionDetail-questionDetail":"pages-questionDetail-questionDetail","pages-feedback-feedback":"pages-feedback-feedback","pages-login-login":"pages-login-login","pages-partiPost-partiPost":"pages-partiPost-partiPost","pages-payOrder-payOrder":"pages-payOrder-payOrder","pages-searchDetails-searchDetails":"pages-searchDetails-searchDetails","pages-tabbar-drycargo-drycargo":"pages-tabbar-drycargo-drycargo","pages-tabbar-mine-mine":"pages-tabbar-mine-mine","pages-tabbar-question-question":"pages-tabbar-question-question","pages-tabbar-release-release":"pages-tabbar-release-release","pages-tabbar-search-search":"pages-tabbar-search-search","pages-teacherDetail-teacherDetail":"pages-teacherDetail-teacherDetail","pages-userinfo-userinfo":"pages-userinfo-userinfo"}[e]||e)+"."+{"pages-aboutUs-aboutUs":"f00552b3","pages-buyLesson-buyLesson":"6bf6a2ae","pages-cargoDetail-cargoDetail~pages-questionDetail-questionDetail":"35e61b5d","pages-cargoDetail-cargoDetail":"9f2898d6","pages-questionDetail-questionDetail":"9c645e70","pages-feedback-feedback":"e2280327","pages-login-login":"d7b4ab6c","pages-partiPost-partiPost":"78de4437","pages-payOrder-payOrder":"8718e180","pages-searchDetails-searchDetails":"7710a11b","pages-tabbar-drycargo-drycargo":"1312f8dd","pages-tabbar-mine-mine":"f44636f9","pages-tabbar-question-question":"8d8629a7","pages-tabbar-release-release":"fdfe539f","pages-tabbar-search-search":"2c50eba0","pages-teacherDetail-teacherDetail":"65279f5c","pages-userinfo-userinfo":"38dd4057"}[e]+".js"}function s(n){if(a[n])return a[n].exports;var t=a[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,s),t.l=!0,t.exports}s.e=function(e){var n=[],t=o[e];if(0!==t)if(t)n.push(t[2]);else{var a=new Promise(function(n,a){t=o[e]=[n,a]});n.push(t[2]=a);var r,u=document.createElement("script");u.charset="utf-8",u.timeout=120,s.nc&&u.setAttribute("nonce",s.nc),u.src=i(e),r=function(n){u.onerror=u.onload=null,clearTimeout(c);var t=o[e];if(0!==t){if(t){var a=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src,i=new Error("Loading chunk "+e+" failed.\n("+a+": "+r+")");i.type=a,i.request=r,t[1](i)}o[e]=void 0}};var c=setTimeout(function(){r({type:"timeout",target:u})},12e4);u.onerror=u.onload=r,document.head.appendChild(u)}return Promise.all(n)},s.m=e,s.c=a,s.d=function(e,n,t){s.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,n){if(1&n&&(e=s(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(s.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var a in e)s.d(t,a,function(n){return e[n]}.bind(null,a));return t},s.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(n,"a",n),n},s.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},s.p="/",s.oe=function(e){throw console.error(e),e};var u=window["webpackJsonp"]=window["webpackJsonp"]||[],c=u.push.bind(u);u.push=n,u=u.slice();for(var l=0;l<u.length;l++)n(u[l]);var g=c;r.push([0,"chunk-vendors"]),t()})({0:function(e,n,t){e.exports=t("1e48")},"0538":function(e,n,t){"use strict";var a=t("288e");Object.defineProperty(n,"__esModule",{value:!0}),n.mock=n.http=void 0;var o=a(t("795b")),r=a(t("cebc")),i=a(t("42e7")),s=new i.default;n.mock=s,s.setConfig(function(e){return e.baseUrl="https://www.fastmock.site/mock/09d86ed8a861337ae7da96bbb47bc39e/shoppage",e.header=(0,r.default)({},e.header),e}),s.interceptor.request(function(e,n){return e}),s.validateStatus=function(e){return 200===e},s.interceptor.response(function(e){if(1===e.data.error_code)return e.data},function(e){return e});var u=new i.default;n.http=u,u.setConfig(function(e){return e.baseUrl="http://xinghuo.com/index.php/index/",e.header=(0,r.default)({},e.header),e}),u.validateStatus=function(e){return 200===e},u.interceptor.response(function(e){return 200!==e.statusCode?o.default.reject(e):(1===e.data.code||(102===e.data.code?uni.reLaunch({url:"/pages/common/login/login"}):uni.showToast({title:e.data.msg||"加载中",icon:"none"})),o.default.resolve(e.data))},function(e){return e})},"0831":function(e,n,t){"use strict";t.r(n);var a=t("ac83"),o=t("1333");for(var r in o)"default"!==r&&function(e){t.d(n,e,function(){return o[e]})}(r);t("9578");var i,s=t("f0c5"),u=Object(s["a"])(o["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],i);n["default"]=u.exports},1333:function(e,n,t){"use strict";t.r(n);var a=t("bc27"),o=t.n(a);for(var r in a)"default"!==r&&function(e){t.d(n,e,function(){return a[e]})}(r);n["default"]=o.a},"1e48":function(e,n,t){"use strict";var a=t("e54b"),o=t("288e"),r=o(t("cebc"));t("cadf"),t("551c"),t("097d"),t("356c"),t("1c31"),t("921b");var i=o(t("e143")),s=o(t("0831")),u=o(t("48a2")),c=a(t("3322")),l=o(t("b90f"));i.default.config.productionTip=!1,i.default.prototype.$api=c,i.default.prototype.websiteUrl="http://xinghuo.tanfangzi.cn",i.default.prototype.getImgUrl=function(e){return this.websiteUrl+e},i.default.prototype.isLogin=function(e){var n=uni.getStorageSync("userInfo");return!!n&&n.token},i.default.prototype.$store=u.default,i.default.prototype.$api=c,i.default.prototype.$utils=l.default,s.default.mpType="app";var g=new i.default((0,r.default)({},s.default));g.$mount()},"279b":function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a={pages:{"pages/tabbar/search/search":{navigationBarTitleText:"搜索",navigationStyle:"custom"},"pages/login/login":{navigationBarTitleText:"登录",navigationBarBackgroundColor:"#389CFB",navigationBarTextStyle:"white",navigationStyle:"custom"},"pages/tabbar/question/question":{navigationBarTitleText:"问答",navigationStyle:"custom"},"pages/tabbar/drycargo/drycargo":{navigationBarTitleText:"干货",navigationStyle:"custom"},"pages/tabbar/release/release":{navigationBarTitleText:"发布帖子",navigationStyle:"custom"},"pages/tabbar/mine/mine":{navigationBarTitleText:"我的",navigationBarBackgroundColor:"#389CFB",navigationBarTextStyle:"white",navigationStyle:"custom"},"pages/searchDetails/searchDetails":{navigationBarTitleText:"搜索",navigationStyle:"custom"},"pages/cargoDetail/cargoDetail":{navigationBarTitleText:"干货详情",navigationStyle:"custom"},"pages/teacherDetail/teacherDetail":{navigationBarTitleText:"讲师详情",navigationStyle:"custom"},"pages/userinfo/userinfo":{navigationBarTitleText:"个人资料",navigationStyle:"custom"},"pages/aboutUs/aboutUs":{navigationBarTitleText:"关于我们",navigationStyle:"custom"},"pages/feedback/feedback":{navigationBarTitleText:"意见反馈",navigationStyle:"custom"},"pages/buyLesson/buyLesson":{navigationBarTitleText:"购买课程",navigationStyle:"custom"},"pages/partiPost/partiPost":{navigationBarTitleText:"参与帖子",navigationStyle:"custom"},"pages/questionDetail/questionDetail":{navigationBarTitleText:"帖子详情",navigationStyle:"custom"},"pages/payOrder/payOrder":{navigationBarTitleText:"支付",navigationStyle:"custom"}},globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"uni-app",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"}};n.default=a},3322:function(e,n,t){"use strict";var a=t("288e");Object.defineProperty(n,"__esModule",{value:!0}),n.go=i,n.usersave=n.topay=n.order=n.buy=n.purchase=n.openid=n.userinfo=n.suggestion=n.mydata=n.bannerpost=n.about=n.phone=n.comment=n.videodeta=n.video=n.issue=n.postdeta=n.searchvideo=n.post=n.banner=void 0;var o=a(t("f499")),r=t("0538");function i(e,n){n?(n=(0,o.default)(n),uni.navigateTo({url:"/pages/"+e+"/"+e+"?data="+n})):uni.navigateTo({url:"/pages/"+e+"/"+e})}var s=function(e){return r.http.post("banner/index",e||{})};n.banner=s;var u=function(e){return r.http.post("video/post",e||{})};n.post=u;var c=function(e){return r.http.post("video/search_video",e||{})};n.searchvideo=c;var l=function(e){return r.http.post("video/postdeta",e||{})};n.postdeta=l;var g=function(e){return r.http.post("video/issue",e||{})};n.issue=g;var d=function(e){return r.http.post("video/video",e||{})};n.video=d;var p=function(e){return r.http.post("video/videodeta",e||{})};n.videodeta=p;var f=function(e){return r.http.post("video/comment",e||{})};n.comment=f;var y=function(e){return r.http.post("banner/phone",e||{})};n.phone=y;var b=function(e){return r.http.post("banner/about",e||{})};n.about=b;var m=function(e){return r.http.post("banner/post",e||{})};n.bannerpost=m;var h=function(e){return r.http.post("banner/mydata",e||{})};n.mydata=h;var _=function(e){return r.http.post("banner/suggestion",e||{})};n.suggestion=_;var v=function(e){return r.http.post("banner/user_info",e||{})};n.userinfo=v;var C=function(e){return r.http.post("banner/openid",e||{})};n.openid=C;var T=function(e){return r.http.post("banner/purchase",e||{})};n.purchase=T;var S=function(e){return r.http.post("video/buy",e||{})};n.buy=S;var D=function(e){return r.http.post("video/order",e||{})};n.order=D;var x=function(e){return r.http.post("video/to_pay",e||{})};n.topay=x;var w=function(e){return r.http.post("banner/user_save",e||{})};n.usersave=w},"356c":function(e,n,t){"use strict";(function(e){var n=t("288e"),a=n(t("5176")),o=n(t("e143"));e["____14021FC____"]=!0,delete e["____14021FC____"],e.__uniConfig={globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"uni-app",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"},tabBar:{borderStyle:"black",backgroundColor:"#FFFFFF",color:"#333333",selectedColor:"#333333",list:[{pagePath:"pages/tabbar/search/search",iconPath:"static/tabbar/taba1.png",selectedIconPath:"static/tabbar/taba2.png",text:"搜索",redDot:!1,badge:""},{pagePath:"pages/tabbar/question/question",iconPath:"static/tabbar/tabb1.png",selectedIconPath:"static/tabbar/tabb2.png",text:"问答",redDot:!1,badge:""},{pagePath:"pages/tabbar/drycargo/drycargo",iconPath:"static/tabbar/tabc1.png",selectedIconPath:"static/tabbar/tabc2.png",text:"干货",redDot:!1,badge:""},{pagePath:"pages/tabbar/mine/mine",iconPath:"static/tabbar/tabd1.png",selectedIconPath:"static/tabbar/tabd2.png",text:"我的",redDot:!1,badge:""}]}},e.__uniConfig.router={mode:"hash",base:"/"},e.__uniConfig["async"]={loading:"AsyncLoading",error:"AsyncError",delay:200,timeout:3e3},e.__uniConfig.debug=!1,e.__uniConfig.networkTimeout={request:6e3,connectSocket:6e3,uploadFile:6e3,downloadFile:6e3},e.__uniConfig.sdkConfigs={},e.__uniConfig.qqMapKey="XVXBZ-NDMC4-JOGUS-XGIEE-QVHDZ-AMFV2",e.__uniConfig.nvue={"flex-direction":"column"},o.default.component("pages-tabbar-search-search",function(e){var n={component:t.e("pages-tabbar-search-search").then(function(){return e(t("ef27"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-login-login",function(e){var n={component:t.e("pages-login-login").then(function(){return e(t("31d9"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-tabbar-question-question",function(e){var n={component:t.e("pages-tabbar-question-question").then(function(){return e(t("3c6e"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-tabbar-drycargo-drycargo",function(e){var n={component:t.e("pages-tabbar-drycargo-drycargo").then(function(){return e(t("3b16"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-tabbar-release-release",function(e){var n={component:t.e("pages-tabbar-release-release").then(function(){return e(t("9932"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-tabbar-mine-mine",function(e){var n={component:t.e("pages-tabbar-mine-mine").then(function(){return e(t("6d8f"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-searchDetails-searchDetails",function(e){var n={component:t.e("pages-searchDetails-searchDetails").then(function(){return e(t("4d92"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-cargoDetail-cargoDetail",function(e){var n={component:Promise.all([t.e("pages-cargoDetail-cargoDetail~pages-questionDetail-questionDetail"),t.e("pages-cargoDetail-cargoDetail")]).then(function(){return e(t("0c29"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-teacherDetail-teacherDetail",function(e){var n={component:t.e("pages-teacherDetail-teacherDetail").then(function(){return e(t("b00e"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-userinfo-userinfo",function(e){var n={component:t.e("pages-userinfo-userinfo").then(function(){return e(t("d13d"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-aboutUs-aboutUs",function(e){var n={component:t.e("pages-aboutUs-aboutUs").then(function(){return e(t("e582"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-feedback-feedback",function(e){var n={component:t.e("pages-feedback-feedback").then(function(){return e(t("b75c"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-buyLesson-buyLesson",function(e){var n={component:t.e("pages-buyLesson-buyLesson").then(function(){return e(t("c589"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-partiPost-partiPost",function(e){var n={component:t.e("pages-partiPost-partiPost").then(function(){return e(t("93e6"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-questionDetail-questionDetail",function(e){var n={component:Promise.all([t.e("pages-cargoDetail-cargoDetail~pages-questionDetail-questionDetail"),t.e("pages-questionDetail-questionDetail")]).then(function(){return e(t("0553"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),o.default.component("pages-payOrder-payOrder",function(e){var n={component:t.e("pages-payOrder-payOrder").then(function(){return e(t("5404"))}.bind(null,t)).catch(t.oe),delay:__uniConfig["async"].delay,timeout:__uniConfig["async"].timeout};return __uniConfig["async"]["loading"]&&(n.loading={name:"SystemAsyncLoading",render:function(e){return e(__uniConfig["async"]["loading"])}}),__uniConfig["async"]["error"]&&(n.error={name:"SystemAsyncError",render:function(e){return e(__uniConfig["async"]["error"])}}),n}),e.__uniRoutes=[{path:"/",alias:"/pages/tabbar/search/search",component:{render:function(e){return e("Page",{props:(0,a.default)({isQuit:!0,isEntry:!0,isTabBar:!0,tabBarIndex:0},__uniConfig.globalStyle,{navigationBarTitleText:"搜索",navigationStyle:"custom"})},[e("pages-tabbar-search-search",{slot:"page"})])}},meta:{id:1,name:"pages-tabbar-search-search",isNVue:!1,pagePath:"pages/tabbar/search/search",isQuit:!0,isEntry:!0,isTabBar:!0,tabBarIndex:0,windowTop:0}},{path:"/pages/login/login",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"登录",navigationBarBackgroundColor:"#389CFB",navigationBarTextStyle:"white",navigationStyle:"custom"})},[e("pages-login-login",{slot:"page"})])}},meta:{name:"pages-login-login",isNVue:!1,pagePath:"pages/login/login",windowTop:0}},{path:"/pages/tabbar/question/question",component:{render:function(e){return e("Page",{props:(0,a.default)({isQuit:!0,isTabBar:!0,tabBarIndex:1},__uniConfig.globalStyle,{navigationBarTitleText:"问答",navigationStyle:"custom"})},[e("pages-tabbar-question-question",{slot:"page"})])}},meta:{id:2,name:"pages-tabbar-question-question",isNVue:!1,pagePath:"pages/tabbar/question/question",isQuit:!0,isTabBar:!0,tabBarIndex:1,windowTop:0}},{path:"/pages/tabbar/drycargo/drycargo",component:{render:function(e){return e("Page",{props:(0,a.default)({isQuit:!0,isTabBar:!0,tabBarIndex:2},__uniConfig.globalStyle,{navigationBarTitleText:"干货",navigationStyle:"custom"})},[e("pages-tabbar-drycargo-drycargo",{slot:"page"})])}},meta:{id:3,name:"pages-tabbar-drycargo-drycargo",isNVue:!1,pagePath:"pages/tabbar/drycargo/drycargo",isQuit:!0,isTabBar:!0,tabBarIndex:2,windowTop:0}},{path:"/pages/tabbar/release/release",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"发布帖子",navigationStyle:"custom"})},[e("pages-tabbar-release-release",{slot:"page"})])}},meta:{name:"pages-tabbar-release-release",isNVue:!1,pagePath:"pages/tabbar/release/release",windowTop:0}},{path:"/pages/tabbar/mine/mine",component:{render:function(e){return e("Page",{props:(0,a.default)({isQuit:!0,isTabBar:!0,tabBarIndex:3},__uniConfig.globalStyle,{navigationBarTitleText:"我的",navigationBarBackgroundColor:"#389CFB",navigationBarTextStyle:"white",navigationStyle:"custom"})},[e("pages-tabbar-mine-mine",{slot:"page"})])}},meta:{id:4,name:"pages-tabbar-mine-mine",isNVue:!1,pagePath:"pages/tabbar/mine/mine",isQuit:!0,isTabBar:!0,tabBarIndex:3,windowTop:0}},{path:"/pages/searchDetails/searchDetails",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"搜索",navigationStyle:"custom"})},[e("pages-searchDetails-searchDetails",{slot:"page"})])}},meta:{name:"pages-searchDetails-searchDetails",isNVue:!1,pagePath:"pages/searchDetails/searchDetails",windowTop:0}},{path:"/pages/cargoDetail/cargoDetail",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"干货详情",navigationStyle:"custom"})},[e("pages-cargoDetail-cargoDetail",{slot:"page"})])}},meta:{name:"pages-cargoDetail-cargoDetail",isNVue:!1,pagePath:"pages/cargoDetail/cargoDetail",windowTop:0}},{path:"/pages/teacherDetail/teacherDetail",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"讲师详情",navigationStyle:"custom"})},[e("pages-teacherDetail-teacherDetail",{slot:"page"})])}},meta:{name:"pages-teacherDetail-teacherDetail",isNVue:!1,pagePath:"pages/teacherDetail/teacherDetail",windowTop:0}},{path:"/pages/userinfo/userinfo",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"个人资料",navigationStyle:"custom"})},[e("pages-userinfo-userinfo",{slot:"page"})])}},meta:{name:"pages-userinfo-userinfo",isNVue:!1,pagePath:"pages/userinfo/userinfo",windowTop:0}},{path:"/pages/aboutUs/aboutUs",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"关于我们",navigationStyle:"custom"})},[e("pages-aboutUs-aboutUs",{slot:"page"})])}},meta:{name:"pages-aboutUs-aboutUs",isNVue:!1,pagePath:"pages/aboutUs/aboutUs",windowTop:0}},{path:"/pages/feedback/feedback",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"意见反馈",navigationStyle:"custom"})},[e("pages-feedback-feedback",{slot:"page"})])}},meta:{name:"pages-feedback-feedback",isNVue:!1,pagePath:"pages/feedback/feedback",windowTop:0}},{path:"/pages/buyLesson/buyLesson",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"购买课程",navigationStyle:"custom"})},[e("pages-buyLesson-buyLesson",{slot:"page"})])}},meta:{name:"pages-buyLesson-buyLesson",isNVue:!1,pagePath:"pages/buyLesson/buyLesson",windowTop:0}},{path:"/pages/partiPost/partiPost",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"参与帖子",navigationStyle:"custom"})},[e("pages-partiPost-partiPost",{slot:"page"})])}},meta:{name:"pages-partiPost-partiPost",isNVue:!1,pagePath:"pages/partiPost/partiPost",windowTop:0}},{path:"/pages/questionDetail/questionDetail",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"帖子详情",navigationStyle:"custom"})},[e("pages-questionDetail-questionDetail",{slot:"page"})])}},meta:{name:"pages-questionDetail-questionDetail",isNVue:!1,pagePath:"pages/questionDetail/questionDetail",windowTop:0}},{path:"/pages/payOrder/payOrder",component:{render:function(e){return e("Page",{props:(0,a.default)({},__uniConfig.globalStyle,{navigationBarTitleText:"支付",navigationStyle:"custom"})},[e("pages-payOrder-payOrder",{slot:"page"})])}},meta:{name:"pages-payOrder-payOrder",isNVue:!1,pagePath:"pages/payOrder/payOrder",windowTop:0}},{path:"/preview-image",component:{render:function(e){return e("Page",{props:{navigationStyle:"custom"}},[e("system-preview-image",{slot:"page"})])}},meta:{name:"preview-image",pagePath:"/preview-image"}},{path:"/choose-location",component:{render:function(e){return e("Page",{props:{navigationStyle:"custom"}},[e("system-choose-location",{slot:"page"})])}},meta:{name:"choose-location",pagePath:"/choose-location"}},{path:"/open-location",component:{render:function(e){return e("Page",{props:{navigationStyle:"custom"}},[e("system-open-location",{slot:"page"})])}},meta:{name:"open-location",pagePath:"/open-location"}}]}).call(this,t("c8ba"))},"42e7":function(e,n,t){"use strict";var a=t("288e");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=a(t("a4bb"));t("ac6a");var r=a(t("f499")),i=a(t("cebc")),s=a(t("795b"));t("96cf");var u=a(t("3b8d")),c=a(t("d225")),l=a(t("b0b4")),g=a(t("bd86")),d=function(){function e(){var n=this;(0,c.default)(this,e),(0,g.default)(this,"config",{baseUrl:"",header:{"content-type":"application/json;charset=UTF-8"},method:"GET",dataType:"json",responseType:"text"}),(0,g.default)(this,"interceptor",{request:function(e){e&&(n.requestBeforeFun=e)},response:function(e,t){e&&t&&(n.requestComFun=e,n.requestComFail=t)}})}return(0,l.default)(e,[{key:"requestBeforeFun",value:function(e){return e}},{key:"requestComFun",value:function(e){return e}},{key:"requestComFail",value:function(e){return e}},{key:"validateStatus",value:function(e){return 200===e}},{key:"setConfig",value:function(e){this.config=e(this.config)}},{key:"request",value:function(){var n=(0,u.default)(regeneratorRuntime.mark(function n(){var t,a=this,o=arguments;return regeneratorRuntime.wrap(function(n){while(1)switch(n.prev=n.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},t.baseUrl=this.config.baseUrl,t.dataType=t.dataType||this.config.dataType,t.responseType=t.responseType||this.config.responseType,t.url=t.url||"",t.data=t.data||{},t.params=t.params||{},t.header=t.header||this.config.header,t.method=t.method||this.config.method,n.abrupt("return",new s.default(function(n,o){var s=!0,u={};t.complete=function(e){e.config=u,a.validateStatus(e.statusCode)?(e=a.requestComFun(e),n(e)):(e=a.requestComFail(e),o(e))};var c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"handle cancel",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,a={errMsg:e,config:n};o(a),s=!1};u=(0,i.default)({},a.requestBeforeFun(t,c));var l=(0,i.default)({},u);if(s){var g=e.posUrl(t.url)?t.url:t.baseUrl+t.url;if("{}"!==(0,r.default)(t.params)){var d=e.addQueryString(t.params);g+=-1===g.indexOf("?")?"?".concat(d):"&".concat(d)}l.url=g,uni.request(l)}}));case 10:case"end":return n.stop()}},n,this)}));function t(){return n.apply(this,arguments)}return t}()},{key:"get",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request((0,i.default)({url:e,method:"GET"},n))}},{key:"post",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request((0,i.default)({url:e,data:n,method:"POST"},t))}},{key:"put",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request((0,i.default)({url:e,data:n,method:"PUT"},t))}},{key:"delete",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request((0,i.default)({url:e,data:n,method:"DELETE"},t))}},{key:"connect",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request((0,i.default)({url:e,data:n,method:"CONNECT"},t))}},{key:"head",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request((0,i.default)({url:e,data:n,method:"HEAD"},t))}},{key:"options",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request((0,i.default)({url:e,data:n,method:"OPTIONS"},t))}},{key:"trace",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request((0,i.default)({url:e,data:n,method:"TRACE"},t))}},{key:"upload",value:function(n,t){var a=this,o=t.filePath,r=t.name,u=t.header,c=t.formData;return new s.default(function(t,s){var l=!0,g={},d={baseUrl:a.config.baseUrl,url:n,filePath:o,method:"UPLOAD",name:r,header:u||a.config.header,formData:c,complete:function(e){e.config=g,200===e.statusCode?(e=a.requestComFun(e),t(e)):(e=a.requestComFail(e),s(e))}},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"handle cancel",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d,t={errMsg:e,config:n};s(t),l=!1};g=(0,i.default)({},a.requestBeforeFun(d,p));var f=(0,i.default)({},g);l&&(f.url=e.posUrl(n)?n:a.config.baseUrl+n,uni.uploadFile(f))})}}],[{key:"posUrl",value:function(e){return/(http|https):\/\/([\w.]+\/?)\S*/.test(e)}},{key:"addQueryString",value:function(e){var n="";return(0,o.default)(e).forEach(function(t){n+=t+"="+e[t]+"&"}),n.substring(0,n.length-1)}}]),e}();n.default=d},"48a2":function(e,n,t){"use strict";var a=t("288e");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=a(t("e143")),r=a(t("2f62"));o.default.use(r.default);var i=new r.default.Store({state:{hasLogin:!1,userInfo:{},address:{},coords:{},isWeixin:"",openid:""},mutations:{login:function(e,n){e.hasLogin=!0,e.userInfo=n,uni.setStorage({key:"userInfo",data:n})},logout:function(e){e.hasLogin=!1,e.userInfo={},uni.removeStorage({key:"userInfo"})},addressinfo:function(e,n){e.address=n,uni.setStorage({key:"address",data:n})},coordsinfo:function(e,n){e.coords=n,uni.setStorage({key:"coords",data:n})},isweixin:function(e,n){console.log(n),e.isWeixin=n},setopenid:function(e,n){e.openid=n,uni.setStorage({key:"openid",data:n})}},actions:{}}),s=i;n.default=s},"56c3":function(e,n,t){var a=t("ef9f");"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var o=t("4f06").default;o("0afb4e03",a,!0,{sourceMap:!1,shadowMode:!1})},"6e05":function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a={appid:"__UNI__14021FC"};n.default=a},9578:function(e,n,t){"use strict";var a=t("56c3"),o=t.n(a);o.a},ac83:function(e,n,t){"use strict";var a,o=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("App",{attrs:{keepAliveInclude:e.keepAliveInclude}})},r=[];t.d(n,"b",function(){return o}),t.d(n,"c",function(){return r}),t.d(n,"a",function(){return a})},b90f:function(e,n,t){"use strict";var a=t("288e");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=a(t("795b"));t("6762");var r=["133","149","153","173","177","180","181","189","199","130","131","132","145","155","156","166","171","175","176","185","186","166","134","135","136","137","138","139","147","150","151","152","157","158","159","172","178","182","183","184","187","188","198"],i=function(e){return 11===e.length&&r.includes(e.slice(0,3))},s=function(e){return new o.default(function(n,t){var a=newTestPhone(e+"");a?n(a):(uni.toast({title:"手机号格式不正确",icon:"none"}),t(a))})},u=function(e){var n=e.title,t=e.icon,a=void 0===t?"success":t,r=e.duration,i=void 0===r?1500:r;return new o.default(function(e,t){uni.showToast({title:n,icon:a,duration:i,success:function(){setTimeout(function(){e()},i)},fail:function(){t()}})})},c={test_phone:i,verifyPhone:s,toast:u};n.default=c},bc27:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a={onLaunch:function(){console.log("App Launch")},onShow:function(){console.log("App Show")},onHide:function(){console.log("App Hide")}};n.default=a},ef9f:function(e,n,t){n=e.exports=t("2350")(!1),n.push([e.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\n/*每个页面公共css */.container{font-size:%?30?%}.flex{display:-webkit-box;display:-webkit-flex;display:flex}.flex1{-webkit-box-flex:1;-webkit-flex:1;flex:1}.fdc{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.jcsb{-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.jcc{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.jcfe{-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.aic{-webkit-box-align:center;-webkit-align-items:center;align-items:center}.por{position:relative}.pof{position:fixed}.poa{position:absolute}.tac{text-align:center}.line{width:100%;height:%?16?%;background-color:#f7f7f7}.bxsbb{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ellipsiss{\r\n\t/* width: 300upx; */overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.nodata{padding:%?100?%;text-align:center}.ylf-button{margin:%?200?% auto;width:%?611?%;height:%?98?%;line-height:%?98?%;border-radius:%?98?%;font-size:$y-fs40;text-align:center;color:#fff;background-color:#60abfc}",""])}}); ```
请问asp怎么获取和处理ajax传过来的formdata数据呢? 我是想存到本地
html大概的结构: ``` <form id="uploadForm" action="uploadImg.ashx" method="post" enctype="multipart/form-data"> <input id="fileImage" type="file" size="30" name="fileselect[]" multiple /> <button type="button" id="fileSubmit" class="upload_submit_btn">确认上传图片</button> ``` Ajax: ``` for (var i = 0, file; file = this.fileFilter[i]; i++) { (function(file) { var formData = new FormData(); formData.append(file.name,file); $.ajax({ url: self.url, type: 'post', data: formData, contentType: false, processData: false, success: function(data) { self.onSuccess(data); self.funDeleteFile(file); }, error: function(data) { console.log("error"); self.onFailure(file); } }) if(!self.fileFilter.length){ //执行完成 self.onComplete(); } })(file); } } ``` 请问我的ashx里面怎么写才可以存入到本地呢?另外也得从本地读取图片然后用ajax传回给html,请问有没有例子示范下,谢谢
求助ajax执行后,会自动刷新页面,该如何阻止?
asp.net mvc 前台代码: ``` <html> <head> <meta name="viewport" content="width=device-width" /> <title>TestUpload</title> <script type="text/javascript" src="~/Scripts/jquery-1.10.2.min.js"></script> </head> <body> <div> <textarea id="txt"></textarea> <form id="uploadForm" action="Upload/TestAjax" method="post" enctype="multipart/form-data"> <input id="File1" name="fileupload" accept="image/gif, image/jpeg" multiple="multiple" type="file" value="" /> <input id="btn" type="button" value="上传" /> </form> </div> </body> </html> <script type="text/javascript"> $(function () { $("#btn").click(function () { var formData = new FormData($("#uploadForm")[0]); //var formData = $("#uploadForm"); $.ajax({ url: "/Upload/TestAjax", data: formData, type: "POST", cache: false, async: true, contentType: false, processData: false, success: function (data) { console.log(data); }, error: function (data) { console.log(data); }, }); return false; }); }); </script> ``` 后台代码 ``` public ActionResult TestUpload() { return View(); } [HttpPost] public ActionResult TestAjax() { if (Request.Files.Count > 0) { if (Request.Files.Count == 1) { HttpPostedFileBase file = Request.Files[0]; if (file.ContentLength > 0) { string title = string.Empty; title = DateTime.Now.Ticks.ToString() + Path.GetExtension(file.FileName); string path = "/upload/" + DateTime.Now.ToString("yyyyMMdd")+"/" + title; path = System.Web.HttpContext.Current.Server.MapPath(path); file.SaveAs(path); return Json(new { status = true, url = path }); } } else { string[] urllist = new string[Request.Files.Count]; for (int i = 0; i < Request.Files.Count; i++) { HttpPostedFileBase file = Request.Files[i]; if (file.ContentLength > 0) { string title = string.Empty; title = DateTime.Now.Ticks.ToString() +Path.GetExtension(file.FileName); string path = "/upload/" + DateTime.Now.ToString("yyyyMMdd") + "/" + title; path = System.Web.HttpContext.Current.Server.MapPath(path); file.SaveAs(path); urllist[i] = path; } } return Json(new { status = true, url = urllist }); } } else { return Json(new { status = false, url = "", msg = "没有文件" }); } return Json(new { status = false, url = "", msg = "" }); } ``` 其实就是一个简单的ajax文件上传。我的要求是,执行成功不要刷新页面。 但是很奇怪的是,执行不成功时,代码不刷新,一旦执行成功就自动给我刷新了!!!跪求各位大大 开发环境WIN10+VS2015
SpringBoot用Map接收FormData数据会丢失二进制文件,这是为什么?
由于业务需求,后端不知道前端会发回来的FormData里的键值对是什么,所以不创建实体类来接收FormData,而用Map来接收参数。 但是,用Map接收FormData时,其他的键值对都可以接收到,但唯独二进制文件丢失了,这是为什么呢? 前端: ![图片说明](https://img-ask.csdn.net/upload/202003/30/1585541250_988471.png) 后端: 接收方式 ![图片说明](https://img-ask.csdn.net/upload/202003/30/1585541135_778608.png) 查看record对象,可以看到file0,file1丢失了 ![图片说明](https://img-ask.csdn.net/upload/202003/30/1585541185_748305.png) 请问大神们这是为什么呢?要如何改正,Map里才有二进制的数据呢?
jquerymobile写的一个登陆页面问题
用jquerymobile写了一个登陆页面,后台是spring3+mybatis,主要的思路是异步提交验证,如果验证失败,直接在页面上提示错误信息,验证成功则通过changePage刷新页面。 遇到的问题是: 1、在spring的controller中返回这个页面后,登录页面虽然展现出来了,但是$(document).ready(function() {...})没有起作用,手工强制刷新页面可以起作用; 2、Ajax的POST方式没有起作用,点击按钮总是GET方式。。。 页面代码如下,请各位大侠帮看下,真心感谢! <%@ page language="java" pageEncoding="UTF-8" %> <%@ include file="/WEB-INF/views/include/taglibs.jsp" %> <!DOCTYPE html> <html> <head> <title>login</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" /> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script type="text/javascript"> function onSuccess(data, status) { data = $.parseJSON(data) //data = $.trim(data); if(data.flag == "Y") { //成功,进入新页面 $.mobile.changePage(data.url); } else { $("#message").css("color", "#ff0000"); $("#message").text(data.msg); } } $(document).ready(function() { alert("ready"); $("#btnLogin").click(function(e){ var formData = $("#frmLogin").serialize(); alert(formData); $.ajax({ type: "POST", url: "${ctx}/login", cache: false, data: formData, success: onSuccess }); e.preventDefault(); }); }); </script> <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script> </head> <body> <div id="message"></div> <form id="frmLogin"> <label for="memberId">会员ID:</label> <input name="memberId" id="memberId" data-mini="true" data-clear-btn="true" type="text" autofocus required> <label for="password">密码:</label> <input name="password" id="password" data-mini="true" type="password" autofocus required> <br/> <div align="center"> <input value="提交验证" id="btnLogin" type=submit data-inline="true" data-mini="true" data-icon="check" data-theme="b"> <!-- <input value="重 填" type="reset" data-inline="true" data-mini="true" data-icon="delete" data-theme="b"> --> </div> </form> </body> </html>
前端form-data传String数组后端如何接收size=1的空字符串
## 前端formdata传一个String数组, 后端用List<String>接收, 如果是传长度为1的空字符串, 后端接收到的是size为0怎么办? 下面是前端传的: ![图片说明](https://img-ask.csdn.net/upload/201909/18/1568771750_904267.png) ## 后端接收到的就是size为0, 然后我用postman试也是这样: ![图片说明](https://img-ask.csdn.net/upload/201909/18/1568771397_853136.png) ![图片说明](https://img-ask.csdn.net/upload/201909/18/1568771379_139602.png) ## 但是如果我传长度为2的空字符串, 后端就接收到了, 长度为2的空字符串数组. ![图片说明](https://img-ask.csdn.net/upload/201909/18/1568771364_712831.png) ![图片说明](https://img-ask.csdn.net/upload/201909/18/1568771347_469200.png) ## 问: 为什么传长度为1的空字符串后端接收却是size为0? 如果我想接收长度为1的空字符串数组该怎么办? 请大佬赐教!
springmvc+ajax上传图片的问题。传过去的是空值,这是为什么?
html代码 <form id="uploadForm" enctype="multipart/form-data"> <div class="email"> <label for="email-input">邮箱*</label> <input id="email" name="email" type="email"/> </div> <div class="name"> <label for="name-input">账号*</label> <input id="account" name="account" type="text"/> </div> <div class="website"> <label for="website-input">密码*</label> <input id="password" name="password" type="password"/> </div> <div class="name"> <label for="name-input">昵称*</label> <input id="nickname" name="nickname" type="text"/> </div> <div class="message"> <label for="message-input">介绍*</label> <textarea id="introduce" name="introduce" ></textarea> </div> <div class="website"> <label >头像*</label> <input id="file" type="file"/> </div> <div id="picTip"></div> <div class="submit"> <input type="button" value="注册" id="btn" name="btn"/> </div> </form> ----------------------------------------------------------------------------------- js代码: <script type="text/javascript"> $(function () { $("#btn").click(function () { var f = $("#file").val(); if(f==null||f==""){ $("#picTip").html("<span style='color:Red'>错误提示:上传文件不能为空,请重新选择文件</span>"); }else{ var extname = f.substring(f.lastIndexOf(".")+1,f.length); extname = extname.toLowerCase();//处理了大小写 if(extname!= "jpeg"&&extname!= "jpg"&&extname!= "gif"&&extname!= "png"){ $("#picTip").html("<span style='color:Red'>错误提示:格式不正确,支持的图片格式为:JPEG、GIF、PNG!</span>"); } } adduser(); }); }); function adduser(){ var email=$("#email").val(); var account=$("#account").val(); var password=$("#password").val(); var nickname=$("#nickname").val(); var introduce=$("#introduce").val(); var formData = new FormData($("#uploadForm")[0]); alert(formData) alert(email) $.ajax({ url:"./zhuce", data:{"email":email,"account":account,"password":password,"nickname":nickname,"introduce":introduce,"formData":formData}, type:"post", async: false, cache: false, contentType: false, processData: false, success: function (data) { if(data=="error"){ alert("注册失败!") } if(data=="success"){ alert("成功!") window.location.href="login.jsp" } } }); } </script> ----------------------------------------------------------------------- 后台controller代码: @RequestMapping(value="/zhuce") @ResponseBody public String zhuce(String email,String account,String password,String nickname,String introduce,@RequestParam(value="file",required = false) CommonsMultipartFile file,HttpServletRequest request, Model model){ System.out.println("邮箱和账号"+email+","+account); System.out.println("hhhh"); System.out.println("filename:"+file.getOriginalFilename()); String path = request.getSession().getServletContext().getContextPath(); System.out.println("path:"+path); return "success"; } ---------------------------------------------------------------- 运行结果是: 邮箱和账号null,null hhhh java.lang.NullPointerException--获取文件名字这里是空的
c#中用ajax和一般处理程序传文件
前台代码 ``` <div class="fk_cont2"> <div class="from1 col-xs-12 col-sm-12 col-md-6 col-lg-6"> <h1>Required Information</h1> <h2><span>Subject</span><input type="text" name="" placeholder="5- 255 characters." id="Subject" maxlength="255"/></h2> <h2><span>Email</span><input type="text" name="" placeholder="Please make sure your email works properly!" id="Email"/></h2> <h3> <span>Message</span> <textarea name="" rows="" cols="" maxlength="3000" id="Message" placeholder="20-3000 characters. Use only English words and punctuation. (Please allow pop-upwindows here to check non-English words and punctuation.) Please describe your message details (such as: product specification, company description, etc.) as clearly as possible to get prompt and precise replies."></textarea> </h3> </div> <div class="from2 col-xs-12 col-sm-12 col-md-6 col-lg-6"> <h1>Additional Information</h1> <div class="from2_s"> <h2> <span>Country</span> <input type="text" name="" placeholder="" id="Country"/> </h2> <h2> <span>Full Name</span> <input type="text" name="" placeholder="" id="name" /> </h2> </div> <h3> <span>Company</span> <input type="text" name="" placeholder="" id="Company" /> </h3> <h4> <span>Phone Number</span> <input type="text" name="" placeholder="-Country code-" id="Countrycode" /> <input type="text" name="" placeholder="-Area code-"id="Areacode" /> <input type="text" name="" placeholder="-Tel Number-"id="tel" /> </h4> <h3> <span>Website</span> <input type="text" name="" placeholder="" id="Website" /> </h3> <div class="text"> <h5> <span>Add Attachment</span> <b>Select file<input type="file" name="" value="" id="file1"/></b> <i></i> <em class="clear"></em> </h5> <h6>( File size is less than 2M )</h6> </div> </div> <div class="btnss col-xs-12 col-sm-12 col-md-6 col-lg-6"> <a href="javascript:void(0)" onclick="TJSubmit()">Submit</a> <%--<a href="">Submit</a>--%> </div> <div class="clear"></div> </div> ``` 点击事件,不仅仅要传文件还有其他的信息一起传递到后台一般处理程序 ``` function TJSubmit() { } ``` 之前有试过网上的formdata在后台一直都获取不到值,可能是我获取的方式不对,所以我想有一套完整的 前台获取,ajax传输,一般处理程序获取,希望大佬能直接点
Springboot Map传到前台,Long值越界问题
@GetMapping("/edit/{csmId}") public String edit(@PathVariable("csmId") Long csmId, ModelMap map){ IBaseDto dtoMap=new BaseDtoImpl(); dtoMap.put("csmId", csmId); List ret=ColumnSaveMainService.findList(dtoMap); if(ret.size()>0){ map.put("formData", ret.get(0)); } return prefix + "/addEdit"; } var add = 'null'; var formData = {"csmId":615181341067051008,"csmName":"costItemList.js-grid","csmTitle":null,"csmRemark":null,"createBy":5,"createAt":"2019-08-25T13:51:01.000+08:00","updateBy":5,"updateAt":"2019-08-25T13:51:58.000+08:00","createByName":null,"updateByName":null}||{ csmId : ext_findNextval() }; csmId是一个Long类型,会越界,大家看一下有什么办法解决
vue.esm.js?efeb:628 [Vue warn]: Missing required prop: "total" 是什麼原因呢
``` <div :class="{'hidden':hidden}" class="pagination-container"> <el-pagination :background="background" :current-page.sync="currentPage" :page-size.sync="pageSize" :layout="layout" :page-sizes="pageSizes" :total="total" v-bind="$attrs" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> </div> ``` this is ---- ``` <script> export default { name: 'user', data () { return { formdata: [], } }, props: { total: { required: true, type: Number }, page: { type: Number, default: 1 }, limit: { type: Number, default: 20 } } </script> ```
在中国程序员是青春饭吗?
今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
C语言荣获2019年度最佳编程语言
关注、星标公众号,不错过精彩内容作者:黄工公众号:strongerHuang近日,TIOBE官方发布了2020年1月编程语言排行榜单。我在前面给过一篇文章《2019年11月C语言接近Ja...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
一份王者荣耀的英雄数据报告
咪哥杂谈本篇阅读时间约为 6 分钟。1前言前一阵写了关于王者的一些系列文章,从数据的获取到数据清洗,数据落地,都是为了本篇的铺垫。今天来实现一下,看看不同维度得到的结论。2环境准备本次实...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
一个程序在计算机中是如何运行的?超级干货!!!
强烈声明:本文很干,请自备茶水!???? 开门见山,咱不说废话! 你有没有想过,你写的程序,是如何在计算机中运行的吗?比如我们搞Java的,肯定写过这段代码 public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } ...
【蘑菇街技术部年会】程序员与女神共舞,鼻血再次没止住。(文末内推)
蘑菇街技术部的年会,别开生面,一样全是美女。
那个在阿里养猪的工程师,5年了……
简介: 在阿里,走过1825天,没有趴下,依旧斗志满满,被称为“五年陈”。他们会被授予一枚戒指,过程就叫做“授戒仪式”。今天,咱们听听阿里的那些“五年陈”们的故事。 下一个五年,猪圈见! 我就是那个在养猪场里敲代码的工程师,一年多前我和20位工程师去了四川的猪场,出发前总架构师慷慨激昂的说:同学们,中国的养猪产业将因为我们而改变。但到了猪场,发现根本不是那么回事:要个WIFI,没有;...
为什么程序猿都不愿意去外包?
分享外包的组织架构,盈利模式,亲身经历,以及根据一些外包朋友的反馈,写了这篇文章 ,希望对正在找工作的老铁有所帮助
Java校招入职华为,半年后我跑路了
何来 我,一个双非本科弟弟,有幸在 19 届的秋招中得到前东家华为(以下简称 hw)的赏识,当时秋招签订就业协议,说是入了某 java bg,之后一系列组织架构调整原因等等让人无法理解的神操作,最终毕业前夕,被通知调往其他 bg 做嵌入式开发(纯 C 语言)。 由于已至于校招末尾,之前拿到的其他 offer 又无法再收回,一时感到无力回天,只得默默接受。 毕业后,直接入职开始了嵌入式苦旅,由于从未...
立即提问