fix
Helius
2021-02-20 45fb4b11ad51bb38306765b11a6747402e382cee
hive-app/common/jssdk/uploadImg.js
@@ -23,7 +23,8 @@
         count: 1,
         sourceType: ['camera'],
         success: (data) => {
            this.pathToBase64(data.tempFilePaths[0])
            this.upload(data.tempFilePaths[0])
            // this.pathToBase64(data.tempFilePaths[0])
         }
      })
   },
@@ -33,7 +34,8 @@
         count: 1,
         sourceType: ['album'],
         success: (data) => {
            this.pathToBase64(data.tempFilePaths[0])
            this.upload(data.tempFilePaths[0])
            // this.pathToBase64(data.tempFilePaths[0])
         }
      })
   },
@@ -51,13 +53,27 @@
      //#endif  
   },
   upload(file){
      httpUtils.request('/api/common/uploadPhotoBase64', {
         base64: 'data:image/jpeg;base64,'+ file
      }, 'POST').then((res) => {
         if(res.status == 200){
            this.callback && this.callback(res.mapInfo.file)
         }else{
            toast.info(res.info)
      // httpUtils.request('/api/common/uploadPhotoBase64', {
      //    base64: file
      // }, 'POST').then((res) => {
      //    console.log(res)
      //    if(res.status == 200){
      //       this.callback && this.callback(res.mapInfo.file)
      //    }else{
      //       toast.info(res.info)
      //    }
      // })
      uni.uploadFile({
         url: httpUtils.baseUrl+'/api/common/uploadImg',
         filePath: file,
         name: 'file',
         success: (res) => {
            let result = JSON.parse(res.data);
            if(result.status == 200){
               this.callback && this.callback(result.mapInfo.file)
            }else{
               toast.info(result.info)
            }
         }
      })
   }