File tree Expand file tree Collapse file tree 4 files changed +14
-53
lines changed
Expand file tree Collapse file tree 4 files changed +14
-53
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @ethan-utils/axios " : minor
3+ ---
4+
5+ feat: 暴露底层 axios 实例 (request.instance) 以支持自定义拦截器
6+ docs: 更新 README.md 和 package.json 配置
Original file line number Diff line number Diff line change @@ -464,58 +464,7 @@ async function batchUpdate(
464464
465465## 版本记录
466466
467- ### v2.0.0
468-
469- ** 重大变更**
470-
471- - 🔄 将 ` direct ` 命名空间改为 ` std ` (标准响应)
472- - 🔄 直接响应方法移至根级别(` request.get ` 等)
473- - 📝 更新 API 文档和使用示例
474-
475- ** 改进**
476-
477- - ✨ 更直观的 API 设计
478- - 📚 完善的文档结构
479- - 🎯 更清晰的使用场景说明
480-
481- ### v1.2.0
482-
483- ** 新增**
484-
485- - ✨ 添加防重复提交插件
486- - ✨ 添加请求体大小限制插件
487- - ✨ 添加未授权处理插件
488- - 📝 完善插件系统文档
489-
490- ** 改进**
491-
492- - 🐛 修复多实例模式下的内存泄漏问题
493- - ⚡ 优化错误处理机制
494- - 📚 增加更多使用示例
495-
496- ### v1.1.0
497-
498- ** 新增**
499-
500- - ✨ 支持多实例模式
501- - ✨ 添加插件系统
502- - ✨ 支持自动重试机制
503-
504- ** 改进**
505-
506- - 🐛 修复 TypeScript 类型定义问题
507- - ⚡ 优化请求性能
508- - 📝 完善 API 文档
509-
510- ### v1.0.0
511-
512- ** 首次发布**
513-
514- - ✨ 基础 HTTP 请求功能
515- - ✨ 支持标准响应和直接响应两种模式
516- - ✨ 自动 Token 注入
517- - ✨ 完整的 TypeScript 支持
518- - 📝 基础文档和示例
467+ 详细更新日志请查看 [ CHANGELOG.md] ( ./CHANGELOG.md ) 。
519468
520469## 贡献指南
521470
Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ interface ApiClient {
2727 config ?: AxiosRequestConfig ,
2828 ) : Promise < T > ;
2929 use < T > ( plugin : AxiosPlugin < T > , options ?: T ) : void ;
30+ /**
31+ * 底层的 Axios 实例,暴露以允许外部进行高级配置(如添加拦截器)
32+ */
33+ instance : AxiosInstance ;
3034 std : {
3135 get < T , R extends BaseResponse < T > = BaseResponse < T > > (
3236 url : string ,
@@ -213,6 +217,7 @@ function createClient(api: AxiosInstance): ApiClient {
213217
214218 return {
215219 ...methods ,
220+ instance : api ,
216221 use < T > ( plugin : AxiosPlugin < T > , options ?: T ) : void {
217222 plugin ( api , options ) ;
218223 } ,
Original file line number Diff line number Diff line change 77 "module" : " ./dist/index.js" ,
88 "types" : " ./dist/index.d.ts" ,
99 "files" : [
10- " dist"
10+ " dist" ,
11+ " CHANGELOG.md"
1112 ],
1213 "exports" : {
1314 "." : {
You can’t perform that action at this time.
0 commit comments