1.0.3 • Published 2 years ago

ty-interface-log v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

INTERFACE-LOG

功能描述:
   1.捕获特定axios实例的接口请求信息 时间+状态+时长
   2.catch指定接口返回的字段是否为空值
   3.接口时长超时警告和异常警告
   4.接口状态时长控制配置

注册使用

npm install ty-interface-log -d
import interfaceLog from 'ty-interface-log'

1.实例化interfaceLog 并 通过Api .use完成参数配置
2.use完成后 直接通过实例上面的Api .showLogPop  来唤醒接口日志ui窗口

ps:use挂载到全局环境 即可位置通用

参数

    interfaceLog.use(axiosInstance,{//配置项
        customStatusKey:'code',//服务端状值key
        customSuccessCode:0,//服务端约定的成功状态值
        dataRoot:'data',//服务端完整数据对象,可以通过正常的对象访问方式 (data.data)
        dataBase:'data',//数据对象 基于dataRoot
        outTime:5000,//时长红色警告值 毫秒
        warningTime:2000,//时长黄色警告值
        emptyTypes:["null",undefined,"{}","[]"],//默认空值校验类型
        logNum:100,//输出总条数
        catchAllerror:true,//是否捕获所有错误,如果是ture则不需要设置单独的接口监听
        logCatchMinTime:200,//最小捕获请求时长 毫秒
        filterUrl:['FileOperate'],//需要被过滤的接口名称
        switch:true,
    });//接口日志

版本

    1.0.1
        1.read完善补充
    1.0.2
        1.bug修复
    1.0.3
        1.bug修复
1.0.2

2 years ago

1.0.1

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago