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) }