搜索结果列表页面开发

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

32
src/api/common/index.ts Normal file
View File

@@ -0,0 +1,32 @@
import request from '@/utils/request';
import * as types from '@/api/common/types';
import { reqCatch } from '@/utils/catch';
export function upload(data: types.commonReqType): Promise<types.commonResType> {
return request({
url: `/api/v1/upload`,
method: 'post',
data
});
}
// 当前用户-项目权限
export function getRepoPermission(params: { repo_id: string }) {
const { repo_id } = params;
return reqCatch(() => request({
url: `/api/v1/projects/${repo_id}/role`,
method: 'get'
}), params);
}
// 当前用户-组织权限
export function getOrgPermission(params:{group_id:string}): Promise<any> {
const { group_id } = params;
return reqCatch(() => request({
url: `/api/v2/groups/${group_id}`,
method: 'get',
params
}, {
customError: true
}));
}

9
src/api/common/types.ts Normal file
View File

@@ -0,0 +1,9 @@
import { type errorType } from '@/api/types/common';
export interface commonReqType {
[propName: string]: any;
}
export interface commonResType extends errorType {
[propName: string]: any;
}