收藏
回答

在使用uni.getUserProfile不能获取到完整用户信息?

uni.getUserProfile({

          desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写

          success: (infoRes) => {

            const userInfo = infoRes.userInfo;

            // 调用后端接口进行登录

在调用uni.getUserProfile不能获取完整的userInfo信息,调试发现有encryptedData加密数据的完整用户信息但是不知道怎么解密,获取用户信息用途主要防止恶意用户违法犯罪的行为时举报拉黑操作,因为今天有一个恶意用户上传色情视频,已经被删除了,并且关闭了上传视频功能和以前的账户注册功能,但是无法控制以后继续违法行为,视频上传代码在下面

chooseVideo() {

      const that = this;

      uni.chooseVideo({

        count: 1, // 默认9

        maxDuration: 60, // 最大时长,单位为秒

        camera: 'back', // 前置或者后置摄像头,默认为前后都有

        sourceType: ['album', 'camera'], // 视频来源,相册 album、相机 camera

        compressed: true, // 是否压缩所选的视频源文件,默认值为true,需要压缩

        success(res) {

          console.log('Selected video:', res);

          that.selectedVideo = res;

        },

        fail(err) {

          console.error('Failed to select video:', err);

        }

      });

    },

 uploadVideo() {

      const that = this;

      if (!this.selectedVideo) {

        uni.showToast({

          title: '请选择一个视频',

          icon: 'none'

        });

        return;

      }


      uni.showLoading({

        title: '上传中...',

        mask: true

      });

      $H.upload('/upload',{

          filePath: this.selectedVideo.tempFilePath

      },(p)=>{

          console.log(p);

      }).then(res=>{

          let cover = $C.imageUrl + res.url;

        $H.post('/personal/save',{

            user_id:this.user.id,

            cover:cover

        });

        console.log('Upload success:', res);

        that.uploadResult = '上传成功';

        uni.hideLoading();

        this.$emit('confirm');

        this.$refs.popup.close();

      }).catch(res=>{

          console.log('Upload failed:', res);

          that.uploadResult = '上传失败';

          uni.hideLoading();

      });

      

    }

现在非常头疼,请微信社区大牛帮忙解决一下这个问题

      

回答关注问题邀请回答
收藏

3 个回答

  • Lıu
    Lıu
    01-21

    上传文字图片视频资料时接入腾讯检测api,若异常不允许上传。

    01-21
    有用
    回复
  • sun
    sun
    01-20

    该接口目前已无法获取用户信息。

    如有获取用户信息需求,需使用头像昵称填写组件。参考https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/userProfile.html

    担心用户上传非法信息,应接入内容安全检测。

    01-20
    有用
    回复 8
    • 向阳花
      向阳花
      01-22
      01-22
      回复
    • 向阳花
      向阳花
      01-22
      点击按钮没有触发绑定的getPhoneNumber事件
      01-22
      回复
    • 向阳花
      向阳花
      01-22
      点击按钮没有触发绑定的getPhoneNumber事件
      01-22
      回复
    • 向阳花
      向阳花
      01-22
      点击按钮没有触发绑定的getPhoneNumber事件
      01-22
      回复
    • 向阳花
      向阳花
      01-22
      点击按钮没有触发绑定的getPhoneNumber事件
      01-22
      回复
    查看更多(3)
  • 智能回答 智能回答 该问答由AI生成
    01-20
    有用
登录 后发表内容