mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
fix(root) pathToWin only when root dir
fix(route) fullPath -> name
This commit is contained in:
parent
0c76d2dbdf
commit
29beabb114
2 changed files with 5 additions and 3 deletions
|
|
@ -11,7 +11,9 @@
|
|||
|
||||
if (root === '/')
|
||||
dir = mellow.pathToWin(dir);
|
||||
else
|
||||
dir = path.join(root + dir);
|
||||
|
||||
return path.join(root + dir);
|
||||
return dir;
|
||||
};
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -158,12 +158,12 @@
|
|||
p.name = DIR_HTML + name + '.html';
|
||||
ponse.sendFile(p);
|
||||
} else if (isFS) {
|
||||
fullPath = name.replace(CloudFunc.FS, '') || '/';
|
||||
name = name.replace(CloudFunc.FS, '') || '/';
|
||||
fullPath = root(name);
|
||||
|
||||
mellow.read(fullPath, function(error, dir) {
|
||||
if (dir)
|
||||
dir.path = format.addSlashToEnd(fullPath);
|
||||
dir.path = format.addSlashToEnd(name);
|
||||
|
||||
if (!error)
|
||||
buildIndex(dir, function(error, data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue