1.1.10 • Published 6 months ago

ift-util v1.1.10

Weekly downloads
-
License
MIT
Repository
-
Last release
6 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

6 months ago

1.1.10

6 months ago

1.1.8

12 months ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.1

2 years ago

1.0.19

2 years ago

1.1.0

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago