
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
fant-axios-adapter
Advanced tools
#### 介绍 `fant-axios-adapter`用于帮助开发者在`uni-app`项目使用`axios`请求库,提供了使用`uni.request`发起网络请求的`axios`适配器。
fant-axios-adapter用于帮助开发者在uni-app项目使用axios请求库,提供了使用uni.request发起网络请求的axios适配器。
yarn add fant-axios-adapter -D
或
npm i fant-axios-adapter --save
yarn add axios -D
// http.ts
import axios from 'axios'
import { uniAdapter } from 'fant-axios-adapter'
axios.defaults.timeout = 60000
export default class ApiClient {
public static server() {
// 可以在这里拦截
const baseURL = import.meta.env.VITE_BASEURL
return ApiClient.create(baseURL)
}
public static create(baseURL: string) {
const instance = axios.create({
withCredentials: true,
baseURL: baseURL,
adapter: uniAdapter // 配置适配器
})
instance.interceptors.request.use(
(request) => {
return request
},
(error) => {
return Promise.reject(error)
}
)
instance.interceptors.response.use(
(response) => {
return response
},
(error) => {
return Promise.reject(error)
}
)
return instance
}
}
// api.ts
http
.server()
.post(
'/login',
{},
{
params: { a: 22 }
}
)
.then((res) => {
return res.data
})
FAQs
#### 介绍 `fant-axios-adapter`用于帮助开发者在`uni-app`项目使用`axios`请求库,提供了使用`uni.request`发起网络请求的`axios`适配器。
The npm package fant-axios-adapter receives a total of 18 weekly downloads. As such, fant-axios-adapter popularity was classified as not popular.
We found that fant-axios-adapter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.