小程序 微信头像 显示暂时无法查看
发布于 6 年前 作者 mjin 8139 次浏览 来自 问答

微信头像 显示不出来

7 回复

为什么在浏览器里可以正常查看,但是在和微信对接的服务器上通过链接得到的图片却是“暂时无法查看”。这个链接就是这样https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83ernKMsq3q8c0nVsR4mEkOg3ICibTIpBtKMzDPJryybhaN9BQibRloicrs08JRovLZdvp9XYDh1icdkUBA/132

请问一下这个问题解决了么

这种情况有解决办法吗?

  小白求大佬提携!!!

覆盖云图片,fileID路径不变,当是前端不会重新加载和显示,       cloudPath: ‘user_head/’+getApp().globalData.id+’_head.png’, 把云图片覆盖,且用时间戳 做路径,会重新加载,但是原图还在,浪费空间

       cloudPath: ‘user_head/’+Date.parse(new Date()) +’_head.png’,如何解决,求教!!!

set_head() {

    var that = this;

    wx.chooseImage({

      count: 1,

      sizeType: [‘original’, ‘compressed’], // 可以指定是原图还是压缩图,默认二者都有

      sourceType: [‘album’, ‘camera’], // 可以指定来源是相册还是相机,默认二者都有

      success: function (res) {

        wx.cloud.uploadFile({

          cloudPath: ‘user_head/’+getApp().globalData.id+’_head.png’,

          filePath: res.tempFilePaths[0],

          success(res) {

            console.log(res.fileID)////////

            that.setData({

              head: res.fileID

            })

           console.log(that.data.head)////////

            admin.doc(getApp().globalData.id).update({

              data: {

                head:res.fileID

              },

              success: function (res) {

                console.log(‘成功’+that.data.head)/////////

              },

              fail: function (res) {

                console.log(‘失败’+that.data.head)//////////

              }

            })

          }

        })

      }

    })

  },

链接提供下

回到顶部