| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport"
- content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
- <title>Title</title>
- </head>
- <body>
- <input type="text" id="title" value="18978059931">
- <input type="text" id="image" value="https://lorempixel.com/450/200/">
- <input type="text" id="image_group" value="https://lorempixel.com/450/200/,https://lorempixel.com/450/200/">
- <input type="text" id="industry" value="111">
- <input type="text" id="content" value="原标题:十九届中央第三轮巡视“剑指”央企">
- <input type="text" id="redirect" value="https://lorempixel.com/450/200/">
- <input type="text" id="province" value="1">
- <input type="text" id="city" value="35">
- <input type="text" id="district" value="380">
- <input type="text" id="start_time" value="2019-3-21 18:30:37">
- <input type="text" id="end_time" value="2019-3-21 18:30:40">
- <input type="text" id="total_num" value="1">
- <input type="text" id="price" value="0.01">
- <input type="text" id="total_price" value="0.01">
- <input type="text" id="guarantee" value="0">
- <input type="text" id="bet_uid" value="2">
- <input type="text" id="bet_money" value="100">
- <input type="text" id="bet_start_time" value="2019-3-21 18:30:56">
- <input type="text" id="bet_end_time" value="2019-3-21 18:31:02">
- <input type="text" id="is_company" value="1">
- <input type="text" id="company_name" value="哈哈哈有限公司">
- <input type="text" id="compny_industry" value="111">
- <input type="text" id="license" value="https://lorempixel.com/450/200/">
- <input type="text" id="license_number" value="12">
- <input type="text" id="guarantee_content" value="今天下不下雨?">
- <input type="text" id="pay_type" value="2">
- <input type="text" id="scene" value="1">
- <button type="botton">提交</button>
- </body>
- <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
- <script>
- $("button").click(function () {
- $.ajax({
- url: 'api/adver/add',
- data: {
- title: $("#title").val(),
- image: $("#image").val(),
- image_group: $("#image_group").val(),
- industry: $("#industry").val(),
- content: $("#content").val(),
- redirect: $("#redirect").val(),
- province: $("#province").val(),
- city: $("#city").val(),
- district: $("#district").val(),
- start_time: $("#start_time").val(),
- end_time: $("#end_time").val(),
- total_num: $("#total_num").val(),
- price: $("#price").val(),
- total_price: $("#total_price").val(),
- guarantee: $("#guarantee").val(),
- bet_uid: $("#bet_uid").val(),
- bet_money: $("#bet_money").val(),
- bet_start_time: $("#bet_start_time").val(),
- bet_end_time: $("#bet_end_time").val(),
- is_company: $("#is_company").val(),
- company_name: $("#company_name").val(),
- company_industry: $("#compny_industry").val(),
- license: $("#license").val(),
- license_number: $("#license_number").val(),
- guarantee_content: $("#guarantee_content").val(),
- pay_type: $("#pay_type").val(),
- scene: $("#scene").val(),
- },
- beforeSend: function (request) {
- request.setRequestHeader("Authorization", 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xMGRzbS53b2h1aWNuLmNvbVwvYXBpXC9sb2dpbiIsImlhdCI6MTU1NjUwMDk4OSwiZXhwIjoxNTU2NTg3Mzg5LCJuYmYiOjE1NTY1MDA5ODksImp0aSI6InAwaW5LYkFZM0hoeU5QeFYiLCJzdWIiOjIxLCJwcnYiOiJmNDFkNzc0ZjA0ZDYxM2FkYmRjYmNlN2Y2ZDcwOThiMjk3NjI5MGY4In0.gPUT-aF8u9hr2SVcMX13oDd-gnNzIDTR0H6z8UQOATk');
- },
- dataType: 'JSON',
- async: true,//请求是否异步,默认为异步
- type: 'POST',
- success: function (data) {
- console.log(data)
- },
- error: function (data) {
- console.log('error')
- $('body').append(data.responseText);
- $("form").attr("target", "_blank");
- console.log(data.responseText)
- }
- });
- });
- </script>
- </html>
|