0.1.4 • Published 4 months ago

dfws-ve-taro-request v0.1.4

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

东方网升公共Request 基类

发布

  1. 更改package.json版本
  2. yarn run build
  3. npm publish 注:镜像源需切换回NPM官方源

链接

示例

  • yarn
  • yarn build

使用之前

该组件依赖于react,tarojs 使用前自行配置react,基于公共request基类(ve-trao-request)来实现和终端请求方式的统一性

何时使用

  • 项目需要公共请求方法时

API

import Taro from '@tarojs/taro';
import Dfws from 've-taro-request';

// 公共请求基类
export const request = (url: string, data: object, method: any = 'get') => {
  /**
   * 公共基类 ve-trao-request
   * @param {any} taro              // 小程序版本
   * @param {object} projectChannel // 东方网升项目公共 header
   * @param {string} url            // 接口地址
   * @param {object | null} data    // 接口参数
   * @param {string} method         // 接口请求方式
   * @param {object | null} headers // 请求公共header参数
   */
  return Dfws.request(Taro, {}, url, data, method);
}

// 配置简历model-request基类
App.request = request;

request props

参数说明类型默认值
taroTaro全局变量object{}
projectChannel东方网升项目公共 headerobject{}
url接口地址string'api/resume/upload'
data接口参数object{}
method接口请求方式string'POSTPUTGETDELETE'
headers请求公共header参数objectnull
debug是否开启调试模式booleanfalse

参考文档

request

0.1.2

4 months ago

0.1.1

4 months ago

0.1.4

4 months ago

0.1.3

4 months ago

0.1.0

5 months ago

0.0.9

5 months ago

0.0.8

6 months ago

0.0.3

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.2

6 months ago

0.0.1

7 months ago