1.1.10 • Published 1 year ago

@heisea/fetch v1.1.10

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

fetch

Using yarn

yarn add @heisea/fetch

使用方式

import { initFetch, plus } from '@heisea/fetch';

// 创建createFetch函数,参数为axios的配置,具体请参考axios。其中errTipFn为错误提示语的调用函数
// 在response.code为非0的情况下库会调用errTipFn方法,这里的Message.error则为elementui的风格,
// 可以根据ui框架定义不同的风格
const createFetch = initFetch({
  baseURL: Config.baseUrl,
  errTipFn: Message.error
});

// plus为针对全量定制的http header的中间件,如果不在全量版使用无需引入plus
/**
 * Config为全量版的配置文件
 * MODE为全量版环境变量即process.env.MODE的值
 * portalMessageSend用于在一包中同基座进行通信的库
 */
const fetch = createFetch([
  plus(Config, MODE, portalMessageSend),
]);

export default fetch;
1.1.10

1 year ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7-0

3 years ago

1.0.8-4

3 years ago

1.0.8-0

3 years ago

1.0.8-2

3 years ago

1.0.2

3 years ago

1.0.1

4 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

0.0.2-2

4 years ago

0.0.2-1

4 years ago

1.0.0

4 years ago

0.0.2-0

4 years ago

0.0.1

4 years ago