ZhengXingchi / ZhengXingchi.github.io

Apache License 2.0
0 stars 0 forks source link

egg #81

Open ZhengXingchi opened 4 years ago

ZhengXingchi commented 4 years ago

ctx.curl的乱码问题

const result = await ctx.helper.curl(searchurl + '?' + searchParam, {
      dataType: 'json', 
      method: 'GET',
      data: {
           city: ctx.helper.encode(city.CityName, 'gb2312'),
      },
      timeout: 1000,
});
ZhengXingchi commented 4 years ago

egg文件上传

egg文件上传接收总结

NodeJs将任意文件(或本地文件)转换为base64(buffer)格式

Nodejs将Buffer转化成Stream