搜索结果列表页面开发

This commit is contained in:
付民康
2025-03-12 18:41:20 +08:00
commit 7cebe8fc00
739 changed files with 88149 additions and 0 deletions

13
src/utils/getRepoId.ts Normal file
View File

@@ -0,0 +1,13 @@
import router from '@/router';
export default function getRepoId(connector: string = '%2F', namespace: string = '', routeName: string = '') {
const routeParams = router.currentRoute.value.params;
let routeNamespace = namespace || routeParams.namespace;
const routeRepoName = routeName || routeParams.repoName;
if (!routeNamespace || !routeRepoName) return null;
routeNamespace = Array.isArray(routeNamespace)
? routeNamespace.join(connector)
: routeNamespace.split('/').join(connector);
const repoId = `${routeNamespace}${connector}${routeRepoName}`;
return repoId;
}