
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@ebscn/http
Advanced tools
1、基于Axios封装的http组件,调用方式保持与Axios一致,新增两个控制参数authorizeOption和errorHandler。
2、authorizeParams适配相应的鉴权方案(目前支持老版本的各种票据ticket以及新版本的jsonWebToken)鉴权信息失效自动更新一次。
3、自定义错误处理函数errorHandler。
4、根据中间件定义的错误码规范处理msg,定位具体服务。
5、业务逻辑错误不按请求错误处理,正常返回。
6、推荐配合adapter使用
import { gdHttp } from 'ebscn-http'
gdHttp({
method: 'get',
url: '/api',
authorizeParams: { 'api-token': 'xxx' } // 鉴权参数,默认为空(JWT为api-tokne的key-value对 票据校验则为票据校验的一系列参数)
errorHandler: myErrorHandler, // 自定义错误处理函数,回调参数为返回体中的msg,错误处理函数会在reject前触发,默认为空
params: {
'test': 'ebscn'
}
})
function myErrorHandler(msg) {
Toast({message: msg})
}
| 错误码(开头4位) | 对应服务 |
|---|---|
| 9001 | IAS服务 |
| 9002 | MACS服务 |
| 9003 | ias-balance服务 |
| 9100 | 业务中台 |
| 9101 | 文件服务 |
| 9102 | 验证码服务 |
| 9103 | 统一认证 |
| 9104 | 一键登录服务 |
| 9105 | 逻辑聚合服务 |
处理后的msg格式为:
“[服务名称]: 具体报错信息,请稍后重试 ”
FAQs
http beta
We found that @ebscn/http demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.