2023年4月
date
装饰器, HTTP请求与Typescript
0. 简单的API封装封装如下API:GET /resource/{id} Response 200 { _id: string; name: string; } 404;POST /resource Payload { name: string; } Response 201 { _id: string; name: string; } 403;实现:class Client { client: AxiosInstance; constructor (baseUrl: string) { this.client = axios.create(...
2023-04-16 1
阅读全文
Copyright © 2024 Zapic's Blog