Commit 3a8f541a by 王昆

gsb

parent dcc1e30c
var fs=require("fs");
var settings=require("../settings");
var os = require("os");
async function asycReadFile(path){
var p=new Promise(function(reslv,reject){
fs.readFile(path,function(err,r){
......@@ -40,7 +42,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
if (platform.toLocaleLowerCase().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