Commit d9b29635 by 宋毅

tj

parent 46937536
...@@ -6,14 +6,14 @@ var marked = require("marked"); ...@@ -6,14 +6,14 @@ var marked = require("marked");
module.exports = function (app) { module.exports = function (app) {
app.get('/doc', function (req, res) { app.get('/doc', function (req, res) {
if (!req.query.key) { // if (!req.query.key) {
res.send("文件不存在!!!"); // res.send("文件不存在!!!");
return; // return;
} // }
if (req.query.key != "doc12345789") { // if (req.query.key != "doc12345789") {
res.send("文件不存在!!!!!!"); // res.send("文件不存在!!!!!!");
return; // return;
} // }
var path = process.cwd() + "/app/front/entry/public/apidoc/README.md"; var path = process.cwd() + "/app/front/entry/public/apidoc/README.md";
fs.readFile(path, function (err, data) { fs.readFile(path, function (err, data) {
if (err) { if (err) {
...@@ -43,16 +43,16 @@ module.exports = function (app) { ...@@ -43,16 +43,16 @@ module.exports = function (app) {
}); });
app.get('/doc/api/:forder/:fileName', function (req, res) { app.get('/doc/api/:forder/:fileName', function (req, res) {
if (req.url != "/doc/api/platform/fgbusinesschance.md") { // if (req.url != "/doc/api/platform/fgbusinesschance.md") {
if (!req.query.key) { // if (!req.query.key) {
res.send("文件不存在!!!"); // res.send("文件不存在!!!");
return; // return;
} // }
if (req.query.key != "doc12345789") { // if (req.query.key != "doc12345789") {
res.send("文件不存在!!!!!!"); // res.send("文件不存在!!!!!!");
return; // return;
} // }
} // }
var forder = req.params["forder"]; var forder = req.params["forder"];
var fileName = req.params["fileName"] || "README.md"; var fileName = req.params["fileName"] || "README.md";
var path = process.cwd() + "/app/front/entry/public/apidoc"; var path = process.cwd() + "/app/front/entry/public/apidoc";
......
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