sunjh 6 lat temu
rodzic
commit
11467b49f1
1 zmienionych plików z 12 dodań i 4 usunięć
  1. 12 4
      src/components/project/Project.vue

+ 12 - 4
src/components/project/Project.vue

@@ -645,6 +645,7 @@ export default {
       //return this.$confirm(`确定移除 ${file.name}?`)
     },
     uploadRequireDoc (param) {
+      this.showLoading()
       const formData = new FormData()
       let config = {
         //添加请求头
@@ -652,12 +653,16 @@ export default {
       }
       formData.append('file', param.file)
       Http.upload(Apis.FILE.REQUIREMENT_FILE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
-        console.log('上传成功')
         this.project.requireDocUrl = res.data
-        console.log(res.data)
+        this.hideLoading()
+        notify('success', '需求文档上传成功')
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '需求文档上传失败:' + error.data)
       })
     },
     uploadApkFile (param) {
+      this.showLoading()
       const formData = new FormData()
       let config = {
         //添加请求头
@@ -665,9 +670,12 @@ export default {
       }
       formData.append('file', param.file)
       Http.upload(Apis.FILE.APK.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
-        console.log('上传成功')
         this.project.fileUrl = res.data
-        console.log(res)
+        this.hideLoading()
+        notify('success', '文件上传成功')
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '文件上传失败')
       })
     },
     setServiceType () {