Commit e6271c96 by 王昆

gsb

parent 6c5db47a
......@@ -40,11 +40,14 @@ module.exports = function (app) {
app.get('/vue/comp/:cname',function(req,res){
var componentName=req.params.cname;
buildComponent(componentName).then(function(r){
let platform = os.platform();
console.log(platform, '----------------');
// windows
let _r = r.replace(/\n\r/g,"");
// linux
_r = _r.replace(/\n/g,"");
res.end(_r,"");
if(platform.startsWith('win')) {
res.end(r.replace(/\n\r/g,""));
} else {
res.end(r.replace(/\n/g,""));
}
});
});
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment