1.0.12 • Published 5 years ago

gov-api v1.0.12

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

用法

  import govApi from 'gov-api';

  const apiService = govApi(apiOptions, config: { baseUrl: string});

apiOptions示例:

{
  appNodes: [() => {
    const base = '/appmodule/api/appmodule';
    return {
      get?: base,
      create?: string ;
      get?: string ;
      update?: string ;
    };
  }, {
     fetchProperties: '*,parent[id,code,name]',
  }],
}

调用:

  data(arg: object | (() => object) = {}) { }
  headers(arg: object | (() => object) = {}) { }
  config(arg: object) { }
  silent(arg: boolean = true) { } // 是否提示错误
  params(arg: object | (() => object) = {}) { }
  transformRequest(arg: AxiosTransformer[] | (() => AxiosTransformer[]) = []) {}
  transformResponse(arg: AxiosTransformer[] | (() => AxiosTransformer[]) = []) {}
  responseInterceptor(arg: InterceptorHandler[] | (() => InterceptorHandler[]) = []) {}
  requestInterceptor(arg: InterceptorHandler[] | (() => InterceptorHandler[]) = []) {}
  subscribe(sub: Function) {}
  send() {}  // 发送请求
  go() {} // send的别名
1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago