avatar_upload.js 491 B

1234567891011121314151617181920
  1. const { avatar_upload, login_cellphone } = require('../main')
  2. const fs = require('fs')
  3. const path = require('path')
  4. async function main() {
  5. const result = await login_cellphone({
  6. phone: '手机号',
  7. password: '密码',
  8. })
  9. const filePath = './test.jpg'
  10. await avatar_upload({
  11. imgFile: {
  12. name: path.basename(filePath),
  13. data: fs.readFileSync(filePath),
  14. },
  15. imgSize: 1012, //图片尺寸,需要正方形图片
  16. cookie: result.body.cookie,
  17. })
  18. }
  19. main()