1.1.6 • Published 6 months ago

am-api-sign v1.1.6

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

API 签名

使用说明 getSignParams会获取请求的 url 中所有参数进行计算,返回一个对象,包含计算后的属性,和原始参数合并后请求。

import { getSignParams } from 'am-api-sign'
const service = axios.create({
  baseURL: 'xxx',
  timeout: 5000,
})
service.interceptors.request.use(
  (config) => {
    // getUri是Axios内置方法
    const url = service.getUri(config)
    const sign_params = getSignParams(url, '项目专有密钥', config.method)
    config.params = Object.assign(config.params, sign_params)
    return config
  },
  (error) => {
    Promise.reject(error)
  }
)
1.1.6

6 months ago

1.1.5

6 months ago

1.1.4

8 months ago

1.1.3

8 months ago

1.1.2

9 months ago

1.1.1

10 months ago

1.1.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago