|
|
|
@ -25,23 +25,24 @@ class Model {
|
|
|
|
|
let dirtree = [dir];
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
|
|
dirtree[i + 1] = list[i];
|
|
|
|
|
let itemStat = await pfs.stat(dirtree[0] + dirtree[i + 1]);
|
|
|
|
|
let itemStat = await pfs.stat(dir + list[i]);
|
|
|
|
|
if (itemStat.isDirectory()) {
|
|
|
|
|
dirtree[i + 1] = await this.dirList(dirtree[0] + dirtree[i + 1] + "/");
|
|
|
|
|
dirtree[i + 1] = await this.dirList(dir + list[i] + "/");
|
|
|
|
|
} else {
|
|
|
|
|
dirtree[i + 1] = list[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return dirtree;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async dirTree() {
|
|
|
|
|
async getDirTree() {
|
|
|
|
|
var baseDir = localStorage.getItem("baseDir");
|
|
|
|
|
|
|
|
|
|
var stat = await pfs.stat(baseDir).catch((e) => {});
|
|
|
|
|
|
|
|
|
|
if (stat == null) {
|
|
|
|
|
var baseDir = "/";
|
|
|
|
|
var baseDir = dir;
|
|
|
|
|
}
|
|
|
|
|
var tree = await this.dirList(baseDir);
|
|
|
|
|
|
|
|
|
|