修复二级目录不能粘帖截图的问题
This commit is contained in:
parent
d64ab53579
commit
cbca3bd21a
|
|
@ -33,21 +33,33 @@ module.exports = {
|
|||
var assetsDirPath, //项目assets文件夹地址
|
||||
creatDirPath, //本次创建图片地址
|
||||
insertPath, //插入文档的图片引用路径
|
||||
writePath, //图片输出路径
|
||||
mdFile;
|
||||
mdFile = new File(editor.getPath());
|
||||
if (mdFile.getParent().getParent().getBaseName() === 'library') {
|
||||
writePath; //图片输出路径
|
||||
var mdFile = new File(editor.getPath());
|
||||
//library直接子级
|
||||
if (mdFile.getParent().getBaseName() === 'library') {
|
||||
assetsDirPath = mdFile.getParent().getParent().getPath() + "/assets";
|
||||
creatDirPath = assetsDirPath + '/';
|
||||
writePath = assetsDirPath + '/';
|
||||
insertPath = '';
|
||||
}
|
||||
//library下一级目录
|
||||
else if (mdFile.getParent().getParent().getBaseName() === 'library') {
|
||||
parentDir = mdFile.getParent();
|
||||
assetsDirPath = parentDir.getParent().getParent().getPath() + "/assets";
|
||||
creatDirPath = assetsDirPath + '/' + parentDir.getBaseName().split('-')[0];
|
||||
writePath = assetsDirPath + '/' + parentDir.getBaseName().split('-')[0] + '/';
|
||||
insertPath = parentDir.getBaseName().split('-')[0] + '/';
|
||||
} else if (mdFile.getParent().getBaseName() === 'library') {
|
||||
assetsDirPath = mdFile.getParent().getParent().getPath() + "/assets";
|
||||
creatDirPath = assetsDirPath + '/';
|
||||
writePath = assetsDirPath + '/';
|
||||
insertPath = '';
|
||||
} else {
|
||||
}
|
||||
//library下二级目录
|
||||
else if (mdFile.getParent().getParent().getParent().getBaseName() === 'library') {
|
||||
parentDir = mdFile.getParent().getParent();
|
||||
assetsDirPath = parentDir.getParent().getParent().getPath() + "/assets";
|
||||
creatDirPath = assetsDirPath + '/' + parentDir.getBaseName().split('-')[0];
|
||||
writePath = assetsDirPath + '/' + parentDir.getBaseName().split('-')[0] + '/';
|
||||
insertPath = parentDir.getBaseName().split('-')[0] + '/';
|
||||
}
|
||||
//其他目录
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue