微信小程序获取用户高清头像
2018-10-16 18:00
344 查看
获取到用户头像的路径之后执行此函数, 返回值及时高清头像路径
[code]function headimgHD(imageUrl) { console.log('原来的头像', imageUrl); imageUrl = imageUrl.split('/'); //把头像的路径切成数组 //把大小数值为 46 || 64 || 96 || 132 的转换为0 if (imageUrl[imageUrl.length - 1] && (imageUrl[imageUrl.length - 1] == 46 || imageUrl[imageUrl.length - 1] == 64 || imageUrl[imageUrl.length - 1] == 96 || imageUrl[imageUrl.length - 1] == 132)) { imageUrl[imageUrl.length - 1] = 0; } imageUrl = imageUrl.join('/'); //重新拼接为字符串 console.log('高清的头像', imageUrl); return imageUrl; } headimgHD('https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83er5prllVA37yiac4Vv8ZAXwbg0Zicibn6ZjsgJ4ha0hmFBY8MUTRMnRTmSlvzPd8XJZzd0icuyGoiakj4A/132');阅读更多
相关文章推荐
- 微信小程序获取用户openid,头像昵称信息,后台java代码
- 微信小程序获取用户头像和昵称
- 微信小程序判断用户是否需要再次授权获取个人信息
- 微信小程序 - 获取用户信息
- 微信小程序如何再次获取用户授权
- 微信小程序中用户唯一ID的获取
- 【微信小程序】用户首次进入小程序拒绝授权,如何再次调用授权页面,获取用户信息userInfo
- 小程序开发中获取用户头像和昵称
- 微信小程序授权获取用户详细信息openid的实例详解
- 微信小程序 获取用户信息(包括openId等敏感信息)
- 微信小程序获取用户OpenId
- 微信接入之获取用户头像
- 微信小程序在java后台获取用户unionid等敏感信息
- 微信小程序维护登录态与获取用户信息
- 微信通过网页获取用户头像与昵称等信息
- 小程序获取用户头像等用户信息
- python获取的信息列表微信公共平台和用户头像
- 微信小程序获取用户openid
- 微信小程序系列-1获取系统信息,地理位置,用户信息