查看: 754|回复: 0

uniapp设置微信头像

[复制链接]

748

主题

39

回帖

3907

积分

管理员

总舵主

积分
3907
QQ
发表于 2024-4-2 13:45:23 | 显示全部楼层 |阅读模式
  1. var that = this;
  2.                                 that.tui.uploadFile('common/upload', e.avatarUrl).then((e) => {
  3.                                         console.log(e)
  4.                                         that.avatar = e.url;
  5.                                         that.avatarUrl = e.fullurl;
  6.                                         that.tui.request('user/avatar', {
  7.                                                 avatar: e.url
  8.                                         }).then((res) => {
  9.                                                 console.log(res)
  10.                                                 if (res.code == 1) {
  11.                                                         uni.setStorageSync('userinfo', res.data.userinfo);
  12.                                                         uni.showToast({
  13.                                                                 title: res.msg,
  14.                                                                 icon: 'none'
  15.                                                         })
  16.                                                 } else {
  17.                                                         uni.showModal({
  18.                                                                 title: '提示',
  19.                                                                 content: res.msg,
  20.                                                                 showCancel: false
  21.                                                         })
  22.                                                 }
  23.                                         })
  24.                                 })
复制代码


道不同,不相为谋!理想要有,万一实现了呢?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:2513533699@qq.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|鲁ICP备19000917号|鲁公网安备37078302000320号

在本版发帖
关注公众号
QQ客服返回顶部