From 5f6fc6bbeb1d1adb1ab3c24c8a0334444a271318 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sun, 29 Sep 2019 14:06:28 +0800 Subject: [PATCH] file --- public/react/src/modules/tpm/TPMRepositoryComponent.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/TPMRepositoryComponent.js b/public/react/src/modules/tpm/TPMRepositoryComponent.js index a24fab844..c9735d46a 100644 --- a/public/react/src/modules/tpm/TPMRepositoryComponent.js +++ b/public/react/src/modules/tpm/TPMRepositoryComponent.js @@ -109,7 +109,7 @@ class TPMRepositoryComponent extends Component { if (!array || array.length === 0) { return false } - return this._isFileName( array[array.length - 1] ) + return this.nameTypeMap[array[array.length - 1]] !== 'tree' && this._isFileName( array[array.length - 1] ) } // listItem 如果是num,则是通过面包屑点击过来的,取pathArray的子集 fetchRepo = (listItem) => { @@ -138,7 +138,8 @@ class TPMRepositoryComponent extends Component { let urlNewPathArray = newPathArray; let fileInPathArray = false; if (newPathArray.length) { - fileInPathArray = (listItem.type !== 'tree' && this._isFileName( newPathArray[newPathArray.length - 1] )) + fileInPathArray = this.nameTypeMap[newPathArray[newPathArray.length - 1]] ? this.nameTypeMap[newPathArray[newPathArray.length - 1]] !== 'tree' + : (listItem.type !== 'tree' && this._isFileName( newPathArray[newPathArray.length - 1] )) if ( fileInPathArray ) { urlNewPathArray = newPathArray.slice(0, newPathArray.length - 1) }