logic-axios
v1.0.5
Published
a logic axios request encapsulation
Downloads
3
Maintainers
Readme
简介
一个基于业务思考封装的axios
依赖包。
安装
npm
npm i logic-axios
yarn
yarn add logic-axios
使用
创建实例
import {createLogicAxios} from "logic-axios";
const logicAxios = createLogicAxios('http://localhost:8080');
发起请求
const {data} = await logicAxios.get("/user/info");
console.log(data)
分页查询
const page = await logicAxios.page("/users", {page: 1, pageSize: 10});
console.log(page.records)
提示:分页的格式对应于MybatisPlus
框架的分页响应结构,其定义为:IPage.java