1.1.10 • Published 8 months ago

ift-util v1.1.10

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

ift-util

用于对请求参数、以及响应做加密、解密操作

使用方法

  1. 安装
npm i ift-util

or

yarn add ift-util
  1. 方法调用 在请求的公共方法中添加
  • 请求
import { iftDecrypt,iftEncrypt } from 'ift-util'

// 快捷POST
function post(url, data, options = {}) {
  return request(url, 'POST', iftEncrypt(data), options)
}
  • 响应
const decryptData = iftDecrypt(response.data)
  • 举个🌰
  1. 图片上传(1.1.3)
getFileSignature(file, type, md5)
  • PC、H5通过input选择文件,使用e.target.files0,获取file
  • 小程序或类小程序等通过chooseMedia()选择方式. 需要传递文件md5.
  1. 多文件上传(版本1.1.7)
  • 调用 getFilesMd5, 获取多个文件的md5. 循环apped file.
const files = e.target.files;
const md5 = await  getFilesMd5(files) 

for (const file of files) {
    form.append("files", file)
  }
  form.append("fileType", fileType);
1.1.9

8 months ago

1.1.10

8 months ago

1.1.8

1 year ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.1

3 years ago

1.0.19

3 years ago

1.1.0

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 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

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago