admin 发表于 2024-4-2 13:45:23

uniapp设置微信头像

var that = this;
                                that.tui.uploadFile('common/upload', e.avatarUrl).then((e) => {
                                        console.log(e)
                                        that.avatar = e.url;
                                        that.avatarUrl = e.fullurl;
                                        that.tui.request('user/avatar', {
                                                avatar: e.url
                                        }).then((res) => {
                                                console.log(res)
                                                if (res.code == 1) {
                                                        uni.setStorageSync('userinfo', res.data.userinfo);
                                                        uni.showToast({
                                                                title: res.msg,
                                                                icon: 'none'
                                                        })
                                                } else {
                                                        uni.showModal({
                                                                title: '提示',
                                                                content: res.msg,
                                                                showCancel: false
                                                        })
                                                }
                                        })
                                })

页: [1]
查看完整版本: uniapp设置微信头像