# @belvoly-vue-aioa/m-core

> 移动前端核心库，包含 `request`, `配置`

Latest version **0.2.10** (published 2026-08-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install @belvoly-vue-aioa/m-core
pnpm add @belvoly-vue-aioa/m-core
yarn add @belvoly-vue-aioa/m-core
bun add @belvoly-vue-aioa/m-core
```

## Health

**Score 50/100 (C)** — status: active.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.10 |
| Published | 2026-08-04 |
| First published | 2020-05-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 155.6 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | xakoy, small-match, apriljq, chenzihao1989 |

## Links

- npm: https://www.npmjs.com/package/@belvoly-vue-aioa/m-core
- npm.io page: https://npm.io/package/@belvoly-vue-aioa/m-core

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.27.2
- [@belvoly-vue-aioa/bvant](https://npm.io/package/@belvoly-vue-aioa/bvant.md) ^0.1.1

## Recent versions

- 0.2.10 (latest) — 2026-08-04
- 0.2.9 — 2024-09-20
- 0.2.8 — 2024-09-20
- 0.2.7 — 2024-08-12
- 0.2.6 — 2024-08-08
- 0.2.5 — 2024-03-27
- 0.2.4 — 2024-03-27
- 0.2.3 — 2023-11-06
- 0.2.2 — 2023-11-06
- 0.2.1 — 2022-11-16
- 0.2.0 — 2022-09-16
- 0.1.16 — 2021-10-13
- 0.1.15 — 2021-01-22
- 0.1.14 — 2021-01-08
- 0.1.13 — 2020-12-23
- … 15 more at https://npm.io/package/@belvoly-vue-aioa/m-core/versions

## README

## 说明
移动前端核心库，包含 `request`, `配置`

### 使用方法
#### requeset 
```js
const { data, success } = await request('/xxx',
        {
            method: 'GET',
            data: { name: 'XX' }
        }
})
```

#### requeset 取消
```js
let abort

const result = request('/xxx',
        {
            method: 'GET',
            data: { name: 'XX' }，
            cancel: (c) => {
                abort = c
            }
        }
})
// 取消
abort()

const { success, isCancel } = await result
if(success) {
    // success = false
}


```

#### requestVariant 
> request的变体方法，返回promise和abort，支持直接取消，参数和返回值和request一样

```js
const { promise, abort } = requestVariant('/x')

setTimeout(abort, 1000)

const { data, success, isCancel } = await promise
if (success) {
    //data
} else if (isCancel) {
    //被取消的
}
```
## 版本记录

### v0.2.9
1. 增加harmony 鸿蒙判断标识

### v 0.2.7
1. 定位返回坐标系标准

### v 0.2.5
1. 增加钉钉政务云SDK整合能力
### v 0.2.4
1. 增加随申办政务云SDK整合能力

### v 0.2.2
1. 修复request 在 www-form-urlencoded格式下，null和undefined变成字符串传递给后端了

### v0.2.1
1. 增加企业微信agentConfig功能
### v0.2.0
1. 升级核心依赖库的版本
### v 0.1.16 
1. 增加`request`的`RequestOption`参数说明

### v 0.1.15
1. 选人组件调用的接口可以在浏览器中直接打开并返回数据，安全检测提升安全不够，需要修改为受保护的public/private接口[#24](https://github.com/xakoy/belvoly-vue-aioa/issues/24)

### v 0.1.13
1. 修复`request`在safari浏览器，当页面使用window.location.href产生302的情况，会显示错误提示。
### v 0.1.12
1. 增加企业微信的配置和支持

### v 0.1.11
1. `request` 增加异常处理`handleCatch` 参数。 修复异常时 没有返回正确的response

### v 0.1.10
1. `request` 增加 isShowError选项，是否默认显示错误信息
2. `request` Get 方式过滤null和undifine选项

### v 0.1.6
1. `request`修复options为`null`BUG

### v 0.1.5
1. `request`增加`cancel`取消的选项，返回值增加`isCancen`判断是否主动取消的
2. 增加`requestVariant`，是`request`的变体，返回 { promise, abort }

### v 0.1.2
1. 修复TS编译的Target为`esnext`，导致编译在低版本浏览器无法运行

---
_Source: https://npm.io/package/@belvoly-vue-aioa/m-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
