docs: 更新首页
parent
bb18e385bd
commit
518b98a222
25
README.md
25
README.md
|
@ -1,19 +1,37 @@
|
||||||
# axios-miniprogram
|
# axios-miniprogram
|
||||||
|
|
||||||
[](https://codecov.io/gh/zjx0905/axios-miniprogram) [](https://badge.fury.io/js/axios-miniprogram) [](https://opensource.org/licenses/MIT)
|
<p style="display: flex;">
|
||||||
|
<a href="https://codecov.io/gh/zjx0905/axios-miniprogram">
|
||||||
|
<img src='https://codecov.io/gh/zjx0905/axios-miniprogram/branch/master/graph/badge.svg?token=WIQVYX2WIK'/>
|
||||||
|
</a>
|
||||||
|
<a style="margin: 0 5px;" href="https://badge.fury.io/js/axios-miniprogram">
|
||||||
|
<img src='https://badge.fury.io/js/axios-miniprogram.svg'/>
|
||||||
|
</a>
|
||||||
|
<a href="https://opensource.org/licenses/MIT">
|
||||||
|
<img src='https://img.shields.io/badge/License-MIT-brightgreen.svg'/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
[中文文档](https://axios-miniprogram.com)
|
[中文文档](https://axios-miniprogram.com)
|
||||||
|
|
||||||
## 安装
|
## 安装
|
||||||
|
|
||||||
|
使用 npm:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm i axios-miniprogram
|
||||||
|
```
|
||||||
|
|
||||||
|
yarn
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ yarn add axios-miniprogram
|
$ yarn add axios-miniprogram
|
||||||
```
|
```
|
||||||
|
|
||||||
或者
|
pnpm
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm i axios-miniprogram
|
$ pnpm i axios-miniprogram
|
||||||
```
|
```
|
||||||
|
|
||||||
[原生小程序也可以直接下载源码包](https://github.com/zjx0905/axios-miniprogram/releases)
|
[原生小程序也可以直接下载源码包](https://github.com/zjx0905/axios-miniprogram/releases)
|
||||||
|
@ -36,6 +54,7 @@ axios-miniprogram 是一款为小程序平台量身定制的轻量级请求库
|
||||||
- 支持 自定义错误处理。
|
- 支持 自定义错误处理。
|
||||||
- 支持 自定义平台适配器
|
- 支持 自定义平台适配器
|
||||||
- 支持 上传/下载
|
- 支持 上传/下载
|
||||||
|
- 支持 派生领域
|
||||||
|
|
||||||
## 目前支持的平台
|
## 目前支持的平台
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,152 @@
|
||||||
import { defineConfig } from 'vitepress';
|
import { defineConfig } from 'vitepress';
|
||||||
import { VitePWA } from 'vite-plugin-pwa';
|
import { VitePWA } from 'vite-plugin-pwa';
|
||||||
import { themeConfig } from './themeConfig';
|
import { createIntroMD } from './utils/createIntroMD';
|
||||||
|
|
||||||
|
createIntroMD();
|
||||||
|
|
||||||
// https://vitepress.dev/reference/site-config
|
// https://vitepress.dev/reference/site-config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
title: 'axios-miniprogram',
|
title: 'axios-miniprogram',
|
||||||
|
titleTemplate: ':title - axios',
|
||||||
description: '基于 Promise 的 HTTP 请求库,适用于各大小程序平台。',
|
description: '基于 Promise 的 HTTP 请求库,适用于各大小程序平台。',
|
||||||
srcDir: 'pages',
|
srcDir: 'pages',
|
||||||
themeConfig,
|
themeConfig: {
|
||||||
|
// https://vitepress.dev/reference/default-theme-config
|
||||||
|
nav: [
|
||||||
|
{
|
||||||
|
text: '指南',
|
||||||
|
link: '/intro',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '配置',
|
||||||
|
link: '/config/preview',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'API',
|
||||||
|
link: '/api/interceptors',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
sidebar: [
|
||||||
|
{
|
||||||
|
text: '指南',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: '简介',
|
||||||
|
link: '/intro',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '开始',
|
||||||
|
link: '/start',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '配置',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: '默认配置',
|
||||||
|
link: '/config/preview',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'method',
|
||||||
|
link: '/config/method',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'dataType',
|
||||||
|
link: '/config/data-type',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'responseType',
|
||||||
|
link: '/config/response-type',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'validateStatus',
|
||||||
|
link: '/config/validate-status',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'paramsSerializer',
|
||||||
|
link: '/config/params-serializer',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'transformRequest',
|
||||||
|
link: '/config/transform-request',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'transformResponse',
|
||||||
|
link: '/config/transform-response',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'errorHandler',
|
||||||
|
link: '/config/error-handler',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'upload',
|
||||||
|
link: '/config/upload',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'download',
|
||||||
|
link: '/config/download',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'adapter',
|
||||||
|
link: '/config/adapter',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'API',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: 'interceptors',
|
||||||
|
link: '/api/interceptors',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'CancelToken',
|
||||||
|
link: '/api/cancel-token',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'isCancel',
|
||||||
|
link: '/api/is-cancel',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'isAxiosError',
|
||||||
|
link: '/api/is-axios-error',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'getUri',
|
||||||
|
link: '/api/get-uri',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'create',
|
||||||
|
link: '/api/create',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'fork <Badge type="warning" text="2.1.0" />',
|
||||||
|
link: '/api/fork',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Axios',
|
||||||
|
link: '/api/axios',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
socialLinks: [
|
||||||
|
{ icon: 'github', link: 'https://github.com/zjx0905/axios-miniprogram' },
|
||||||
|
],
|
||||||
|
|
||||||
|
returnToTopLabel: '返回顶部',
|
||||||
|
outlineTitle: '导航栏',
|
||||||
|
darkModeSwitchLabel: '主题',
|
||||||
|
footer: {
|
||||||
|
message:
|
||||||
|
'根据 <a href="https://github.com/zjx0905/axios-miniprogram/blob/main/LICENSE">MIT License</a> 发布',
|
||||||
|
copyright:
|
||||||
|
'Copyright © 2020-至今 <a href="https://github.com/zjx0905">zjx0905</a>',
|
||||||
|
},
|
||||||
|
},
|
||||||
vite: {
|
vite: {
|
||||||
plugins: [
|
plugins: [
|
||||||
VitePWA({
|
VitePWA({
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
import theme from 'vitepress/theme';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
...theme,
|
||||||
|
};
|
|
@ -1,58 +0,0 @@
|
||||||
import { DefaultTheme } from 'vitepress';
|
|
||||||
|
|
||||||
export const themeConfig: DefaultTheme.Config = {
|
|
||||||
// https://vitepress.dev/reference/default-theme-config
|
|
||||||
nav: [
|
|
||||||
{ text: '指南', link: '/guide/introduction' },
|
|
||||||
{ text: '配置', link: '/config/preview' },
|
|
||||||
{ text: 'API', link: '/api/interceptors' },
|
|
||||||
],
|
|
||||||
|
|
||||||
sidebar: [
|
|
||||||
{
|
|
||||||
text: '指南',
|
|
||||||
items: [
|
|
||||||
{ text: '简介', link: '/guide/introduction' },
|
|
||||||
{ text: '快速上手', link: '/guide/quick-start' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '配置',
|
|
||||||
items: [
|
|
||||||
{ text: '默认配置', link: '/config/preview' },
|
|
||||||
{ text: 'method', link: '/config/method' },
|
|
||||||
{ text: 'dataType', link: '/config/data-type' },
|
|
||||||
{ text: 'responseType', link: '/config/response-type' },
|
|
||||||
{ text: 'validateStatus', link: '/config/validate-status' },
|
|
||||||
{ text: 'paramsSerializer', link: '/config/params-serializer' },
|
|
||||||
{ text: 'transformRequest', link: '/config/transform-request' },
|
|
||||||
{ text: 'transformResponse', link: '/config/transform-response' },
|
|
||||||
{ text: 'errorHandler', link: '/config/error-handler' },
|
|
||||||
{ text: 'upload', link: '/config/upload' },
|
|
||||||
{ text: 'download', link: '/config/download' },
|
|
||||||
{ text: 'adapter', link: '/config/adapter' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'API',
|
|
||||||
items: [
|
|
||||||
{ text: 'interceptors', link: '/api/interceptors' },
|
|
||||||
{ text: 'CancelToken', link: '/api/cancel-token' },
|
|
||||||
{ text: 'isCancel', link: '/api/is-cancel' },
|
|
||||||
{ text: 'isAxiosError', link: '/api/is-axios-error' },
|
|
||||||
{ text: 'getUri', link: '/api/get-uri' },
|
|
||||||
{ text: 'create', link: '/api/create' },
|
|
||||||
{ text: 'fork', link: '/api/fork' },
|
|
||||||
{ text: 'Axios', link: '/api/axios' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
socialLinks: [
|
|
||||||
{ icon: 'github', link: 'https://github.com/zjx0905/axios-miniprogram' },
|
|
||||||
],
|
|
||||||
|
|
||||||
returnToTopLabel: '返回顶部',
|
|
||||||
outlineTitle: '导航栏',
|
|
||||||
darkModeSwitchLabel: '主题',
|
|
||||||
};
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { copyFileSync } from 'node:fs';
|
||||||
|
import { resolve } from '../../../scripts/utils';
|
||||||
|
|
||||||
|
const readmePath = resolve('README.md');
|
||||||
|
const introPath = resolve('docs/pages/intro.md');
|
||||||
|
|
||||||
|
export function createIntroMD() {
|
||||||
|
copyFileSync(readmePath, introPath);
|
||||||
|
}
|
|
@ -5,20 +5,26 @@ layout: home
|
||||||
hero:
|
hero:
|
||||||
name: 'axios-miniprogram'
|
name: 'axios-miniprogram'
|
||||||
text: '基于 Promise 的 HTTP 请求库,适用于各大小程序平台。'
|
text: '基于 Promise 的 HTTP 请求库,适用于各大小程序平台。'
|
||||||
tagline: My great project tagline
|
tagline: 通用小程序请求库
|
||||||
actions:
|
actions:
|
||||||
- theme: brand
|
|
||||||
text: 介绍
|
|
||||||
link: /guide/introduction
|
|
||||||
- theme: alt
|
- theme: alt
|
||||||
text: 安装
|
text: 简介
|
||||||
link: /guide/quick-start
|
link: /intro
|
||||||
|
- theme: brand
|
||||||
|
text: 开始
|
||||||
|
link: /start
|
||||||
|
|
||||||
features:
|
features:
|
||||||
- title: 轻量
|
- title: 节省空间
|
||||||
details: 不足 10kb
|
details: 包尺寸仅 10 kb,不会占用您太多空间
|
||||||
|
icon: 🤌
|
||||||
|
- title: 简单易用
|
||||||
|
details: 提供了简单易用的 API,并且具有很强的可拓展性
|
||||||
|
icon: 🎯
|
||||||
|
- title: 方便快捷
|
||||||
|
details: 除了提供 npm 安装包以外,还为原生小程序提供开箱即用的源码包
|
||||||
|
icon: 📦
|
||||||
- title: 跨平台
|
- title: 跨平台
|
||||||
details: 兼容各个小程序
|
details: 我很全能,所有小程序平台都可以兼容
|
||||||
- title: 方便
|
icon: 🎭
|
||||||
details: 任何形式的项目都可使用
|
|
||||||
---
|
---
|
||||||
|
|
|
@ -1,28 +1,37 @@
|
||||||
---
|
|
||||||
title: 简介
|
|
||||||
sidebarDepth: 1
|
|
||||||
lastUpdated: true
|
|
||||||
sitemap:
|
|
||||||
priority: 0.8
|
|
||||||
---
|
|
||||||
|
|
||||||
# axios-miniprogram
|
# axios-miniprogram
|
||||||
|
|
||||||
[](https://badge.fury.io/js/axios-miniprogram)
|
<p style="display: flex;">
|
||||||
[](https://opensource.org/licenses/MIT)
|
<a href="https://codecov.io/gh/zjx0905/axios-miniprogram">
|
||||||
|
<img src='https://codecov.io/gh/zjx0905/axios-miniprogram/branch/master/graph/badge.svg?token=WIQVYX2WIK'/>
|
||||||
|
</a>
|
||||||
|
<a style="margin: 0 5px;" href="https://badge.fury.io/js/axios-miniprogram">
|
||||||
|
<img src='https://badge.fury.io/js/axios-miniprogram.svg'/>
|
||||||
|
</a>
|
||||||
|
<a href="https://opensource.org/licenses/MIT">
|
||||||
|
<img src='https://img.shields.io/badge/License-MIT-brightgreen.svg'/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
[中文文档](https://axios-miniprogram.com)
|
[中文文档](https://axios-miniprogram.com)
|
||||||
|
|
||||||
## 安装
|
## 安装
|
||||||
|
|
||||||
|
使用 npm:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm i axios-miniprogram
|
||||||
|
```
|
||||||
|
|
||||||
|
yarn
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ yarn add axios-miniprogram
|
$ yarn add axios-miniprogram
|
||||||
```
|
```
|
||||||
|
|
||||||
或者
|
pnpm
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm i axios-miniprogram
|
$ pnpm i axios-miniprogram
|
||||||
```
|
```
|
||||||
|
|
||||||
[原生小程序也可以直接下载源码包](https://github.com/zjx0905/axios-miniprogram/releases)
|
[原生小程序也可以直接下载源码包](https://github.com/zjx0905/axios-miniprogram/releases)
|
||||||
|
@ -45,6 +54,7 @@ axios-miniprogram 是一款为小程序平台量身定制的轻量级请求库
|
||||||
- 支持 自定义错误处理。
|
- 支持 自定义错误处理。
|
||||||
- 支持 自定义平台适配器
|
- 支持 自定义平台适配器
|
||||||
- 支持 上传/下载
|
- 支持 上传/下载
|
||||||
|
- 支持 派生领域
|
||||||
|
|
||||||
## 目前支持的平台
|
## 目前支持的平台
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
"lib": ["DOM", "ESNext"],
|
"lib": ["DOM", "ESNext"],
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
|
"allowJs": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
|
@ -14,7 +15,7 @@
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"types": ["vite-plugin-pwa/client", "vitepress"]
|
"types": ["vitepress"]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./.vitepress/**/*.ts",
|
"./.vitepress/**/*.ts",
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/zjx0905/axios-miniprogram/issues"
|
"url": "https://github.com/zjx0905/axios-miniprogram/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/zjx0905/axios-miniprogram#readme",
|
"homepage": "https://axios-miniprogram.com",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"cz": "czg",
|
"cz": "czg",
|
||||||
|
|
Loading…
Reference in New Issue