zhangxiaoxu123456
2021-12-20 301289e539c417995f95f5cb91fd1f6043bb7cfd
unpackage/dist/dev/mp-weixin/components/oss-upload/oss-upload.js
@@ -174,35 +174,22 @@
    return {
      avatar: __webpack_require__(/*! ../../static/img/touxiang.jpg */ 321),
      formData: {},
      action: 'http://39.96.92.240:8099/user/updateImg',
      action: 'http://Shuinigonghui.cn:8099/user/updateImg',
      userId: '',
      autoUpload: true };
      autoUpload: true,
      userInfo: '' };
  },
  created: function created() {
    console.log("--------created");
    _this = this;
    // uni.$on('uAvatarCropper', path => {
    //    _this.avatar = path;
    // 可以在此上传到服务端
    // uni.uploadFile({
    //    url: 'http://192.168.100.17/index.php/index/index/upload',
    //    filePath: path,
    //    name: 'file',
    //    complete: (res) => {
    //       console.log(res);
    //    }
    // });
    // })
  },
  mounted: function mounted() {
    var userInfo = this.getStore('userInfo');
    this.avatar = userInfo.img;
    this.userInfo = this.getStore('userInfo');
    this.avatar = this.userInfo.img;
    if (this.avatar == '') {
      this.avatar = '../../static/img/touxiang.jpg';
    }
    _this.userId = userInfo.id;
    _this.formData.userId = userInfo.id;
    this.userId = this.userInfo.id;
    this.formData.userId = this.userInfo.id;
  },
  methods: {
@@ -212,9 +199,9 @@
    },
    onSuccess: function onSuccess(data, index, lists, name) {
      // this.$refs.upload.remove(0)
      this.$refs.upload.remove(0);
      this.avatar = data.obj.img;
      userInfo.img = data.obj.img;
      this.userInfo.img = data.obj.img;
      // this.setStore("userInfo",data.obj)
      this.$u.toast('修改成功');