var fs=require("fs"),http=require("http");var download=function(o,t,n){var e=fs.createWriteStream(t);http.get(o,function(o){o.on("data",function(o){e.write(o)}).on("end",function(){n(null)})},function(o){n(o)})};var photo={origin:"http://img1.xxpie.com/lkqEvKEqeqE0Rvs1gFWtPBto5yHX.JPG?e=1521037451&token=C8FPxG2IPHtDmtLKn5YCeZdF7OAlefKwHu-rPykj:-NIwL7E1tSS2ZsusApEZ1UD5ylo="};var localPath="C:/Users/zq/AppData/Roaming/com.xxpie.psplugin/cache/test.jpg";download(photo.origin,localPath,function(o,t){console.log("下载成功");console.log("正在打开"+localPath);console.log("打开成功")});