禾匠V4批量添加导入商品curl脚本 禾匠V4教程
打开开发者工具(如图),保存商品之后看下调用了哪个接口,对这个接口保存为curl脚本。禾匠V4
curl 模拟请求商品保存接口。批量生成curl脚本执行就好了
脚本代码如下:(替换成自己域名)
curl \'https://v4.nikyou.cn/web/index.php?r=mall%2Fgoods%2Fedit\' -H \'authority: v4.nikyou.cn\' -H \'pragma: no-cache\' -H \'cache-control: no-cache\' -H \'accept: application/json, text/plain, */*\' -H \'origin: https://v4.nikyou.cn\' -H \'x-requested-with: XMLHttpRequest\' -H \'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36\' -H \'content-type: application/x-www-form-urlencoded\' -H \'sec-fetch-site: same-origin\' -H \'sec-fetch-mode: cors\' -H \'referer: https://v4.nikyou.cn/web/index.php?r=mall%2Fgoods%2Fedit&page=1\' -H \'accept-encoding: gzip, deflate, br\' -H \'accept-language: zh-CN,zh;q=0.9,en;q=0.8\' -H \'cookie: __login_route=%2Fadmin%2Fpassport%2Flogin; __mall_id=1; __login_role=admin; search={\"keyword\":\"\",\"status\":\"-1\",\"sort_prop\":\"\",\"sort_type\":\"\",\"cats\":[],\"date_start\":null,\"date_end\":null}; UM_distinctid=16d6e41fc177bb-03d1be3b047652-1d3d6b55-13c680-16d6e41fc18729; HJ_SESSION_ID=ohq05qpb2vr75erdblp9f6g1p4; _csrf=e91060e50fecd6e67c2b2f28237561d9429c12ac436dbde1e20967d875031fbda%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22rTYutU80fN4q7XUpLcRgiB8jfTDF7iIR%22%3B%7D\' --data \'form=%7B%22attr%22%3A%5B%5D%2C%22cats%22%3A%5B%225%22%5D%2C%22mchCats%22%3A%5B%5D%2C%22cards%22%3A%5B%5D%2C%22services%22%3A%5B%5D%2C%22pic_url%22%3A%5B%7B%22id%22%3A%2216%22%2C%22pic_url%22%3A%22http%3A%2F%2Fzoott-attachment.oss-cn-beijing.aliyuncs.com%2Fuploads%2Fmall1%2F20191213%2Ff0b7cf9d54a7e9d421f6a3d00ad6903a.png%22%7D%5D%2C%22use_attr%22%3A0%2C%22goods_num%22%3A%22100%22%2C%22status%22%3A0%2C%22unit%22%3A%22%E4%BB%B6%22%2C%22virtual_sales%22%3A0%2C%22cover_pic%22%3A%22%22%2C%22sort%22%3A100%2C%22accumulative%22%3A0%2C%22confine_count%22%3A-1%2C%22confine_order_count%22%3A-1%2C%22forehead%22%3A0%2C%22forehead_integral%22%3A0%2C%22forehead_integral_type%22%3A1%2C%22freight_id%22%3A0%2C%22freight%22%3Anull%2C%22give_integral%22%3A0%2C%22give_integral_type%22%3A1%2C%22individual_share%22%3A0%2C%22is_level%22%3A1%2C%22is_level_alone%22%3A0%2C%22pieces%22%3A0%2C%22share_type%22%3A0%2C%22attr_setting_type%22%3A0%2C%22video_url%22%3A%22%22%2C%22is_quick_shop%22%3A0%2C%22is_sell_well%22%3A0%2C%22is_negotiable%22%3A0%2C%22share_commission_first%22%3A%22%22%2C%22share_commission_second%22%3A%22%22%2C%22share_commission_third%22%3A%22%22%2C%22name%22%3A%22%E5%95%86%E5%93%81%E5%90%8D%E7%A7%B0%22%2C%22price%22%3A%2210%22%2C%22original_price%22%3A0%2C%22cost_price%22%3A0%2C%22detail%22%3A%22%3Cp%3E%3Cspan%20style%3D%5C%22color%3A%20rgb%2896%2C%2098%2C%20102%29%3B%20font-family%3A%20%26quot%3BPingFang%20SC%26quot%3B%3B%20text-align%3A%20right%3B%20background-color%3A%20rgb%28255%2C%20255%2C%20255%29%3B%5C%22%3E%E5%95%86%E5%93%81%E6%8F%8F%E8%BF%B0%3C%2Fspan%3E%3C%2Fp%3E%22%2C%22extra%22%3A%22%22%2C%22app_share_title%22%3A%22%22%2C%22app_share_pic%22%3A%22%22%2C%22is_default_services%22%3A1%2C%22member_price%22%3A%7B%7D%2C%22goods_no%22%3A%22%22%2C%22goods_weight%22%3A%22%22%2C%22select_attr_groups%22%3A%5B%5D%2C%22goodsWarehouse_attrGroups%22%3A%5B%5D%2C%22attr_default_name%22%3A%22%22%2C%22is_area_limit%22%3A0%2C%22area_limit%22%3A%5B%7B%22list%22%3A%5B%5D%7D%5D%7D&attrGroups=%5B%5D&_csrf=SlX6zAH1BJyB8a2U-M_yTg9sYEz1UM_3-skW4EHATLQ4AaO5daA8rOe_meXPl6c-Qw8yK5wS952cnVKmdqkF5g%3D%3D\' --compressed