文档
测试

订单图片上传

POST
aladdin.com/business/order/{orderId}/addImg

接口描述

用户提交快件,员工精确订单信息后点击揽收订单,同时本地打印订单图片,上传订单图片,ajax传输

请求头

参数名
类型
描述
必填
token
String
凭证
必填

请求体

参数名
类型
描述
必填
imgUrl
String
图片地址
必填

说明 / 示例

使用第三方接口sm.ms,返回服务器url 接口详情:https://doc.sm.ms/#api-Image-Upload ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> </head> <body> <input type="file" id="uploadFile" name="smfile" enctype="multipart/form-data"/> <div id="res"></div> <script> //上传图片 返回一个网络图片路径url $('#uploadFile').change(function(){ var f=this.files[0]; var formData=new FormData(); formData.append('smfile',f); //参数smfile,图片流 $.ajax({ url: 'https://sm.ms/api/upload', type: 'POST', success: function(data){ console.log(data); $('#res').html(JSON.stringify(data.data.url));//图片url }, error: function(data){ console.log(data); }, data:formData, cache: false, contentType: false, processData: false }); }); </script> </body> </html> </script>