搜索结果列表页面开发
This commit is contained in:
32
src/api/common/index.ts
Normal file
32
src/api/common/index.ts
Normal 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
9
src/api/common/types.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user