Skip to content

Commit

Permalink
feat:增加鸿蒙仓库前端 #2877
Browse files Browse the repository at this point in the history
  • Loading branch information
lannoy0523 committed Jan 9, 2025
1 parent f2eef5b commit 2cc3d80
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,12 @@ export default {
// 包搜索-仓库数量
searchRepoList (_, { projectId, repoType, packageName }) {
const isGeneric = repoType === 'generic'
const type = repoType === 'ohpm' ? 'npm' : repoType
return Vue.prototype.$ajax.get(
`${prefix}/${isGeneric ? 'node' : 'package'}/search/overview`,
{
params: {
projectId,
repoType: type.toUpperCase(),
repoType: repoType.toUpperCase(),
[isGeneric ? 'name' : 'packageName']: `*${packageName}*`,
...(MODE_CONFIG === 'ci' && isGeneric
? {
Expand All @@ -103,7 +102,6 @@ export default {
// 跨仓库搜索
searchPackageList (_, { projectId, repoType, repoName, repoNames = [], packageName, property = 'name', direction = 'ASC', current = 1, limit = 20, extRules = [] }) {
const isGeneric = repoType === 'generic'
const type = repoType === 'ohpm' ? 'npm' : repoType
return Vue.prototype.$ajax.post(
`${prefix}/${isGeneric ? 'node/queryWithoutCount' : 'package/search'}`,
{
Expand All @@ -124,10 +122,10 @@ export default {
operation: 'EQ'
}]
: []),
...((MODE_CONFIG === 'ci' ? !isGeneric : true) && type
...((MODE_CONFIG === 'ci' ? !isGeneric : true) && repoType
? [{
field: 'repoType',
value: type.toUpperCase(),
value: repoType.toUpperCase(),
operation: 'EQ'
}]
: []),
Expand Down

0 comments on commit 2cc3d80

Please sign in to comment.