1.0.7 • Published 6 years ago
bkyj-data-transport v1.0.7
保客云后台管理系统ajax核心模块
1、引入插件
import bkyjDataTransport from 'bkyj-data-transport'
- 路径根据项目填写,名字起得自己开心就好
2、调用
bkyjDataTransport.http(method,url,body,successFun,errorFun,selfParam,debug)
- ==必填==-method:为字符串'POST'('post')、'GET'('get')(大小写均可)
- ==必填==—url:地址,不带参数(无论是那种方法)
==必填==—body:json对象,固定属性requestHeaders为请求头(需要改请求头部时使用,需要传入完整头部参数)
选填—successFun:返回成功执行的方法的方法名,该方法默认参数为返回成功的data,即successFun(data)
- 选填—errorFun:返回失败执行的方法的方法名,errorFun()
- 选填—selfParam:私有参数,有时需要用到,最好以对象的形式传入
- 选填—debug:true/false,开发时调试使用,开启后会在控制台打印相应的参数
开发者
npm test
: 执行测试用例
$ npm test
> bkyj-data-transport@1.0.0 test /Users/vlaw/Projects.bky/bkyj-data-transport
> mocha
Array
#indexOf()
✓ should return -1 when the value is not present
1 passing (6ms)
npm run lint
: 执行代码检查
$ npm run lint
> bkyj-data-transport@1.0.0 lint /Users/vlaw/Projects.bky/bkyj-data-transport
> npm run lint:eslint
> bkyj-data-transport@1.0.0 lint:eslint /Users/vlaw/Projects.bky/bkyj-data-transport
> eslint . --ignore-path .gitignore --ignore-pattern internals/scripts || true
/Users/vlaw/Projects.bky/bkyj-data-transport/index.js
9:32 error Unexpected console statement no-console
10:28 error Unexpected console statement no-console
22:8 error Missing semicolon semi
27:8 error Missing semicolon semi
53:9 error Unexpected console statement no-console
54:9 error Unexpected console statement no-console
55:9 error Unexpected console statement no-console
61:9 error Unexpected console statement no-console
68:7 error Unexpected console statement no-console
69:7 error Missing semicolon semi
71:2 error Missing semicolon semi
✖ 11 problems (11 errors, 0 warnings)
1.0.7
6 years ago