export interface paths {
"/api/demo/v1/test": {
get: operations["testUsingGET"];
};
"/api/demo/v1/userInfo": {
get: operations["userInfoUsingGET"];
};
}
function sevice<M> (api:'/api/demo/v1/test',method:M):Promise<paths["/api/demo/v1/test"][M]>
function sevice<M>(api,method:M){
return Promise.resolve({})
}
const res = await sevice('/api/demo/v1/test','get')
可以试试给 M 一个限制: