瀏覽代碼

接收任务

xuexiaobo 6 年之前
父節點
當前提交
d0476d0cb1
共有 3 個文件被更改,包括 10 次插入7 次删除
  1. 4 4
      package-lock.json
  2. 4 1
      src/components/task/Task.vue
  3. 2 2
      src/js/api.js

+ 4 - 4
package-lock.json

@@ -538,7 +538,7 @@
     },
     "axios": {
       "version": "0.19.0",
-      "resolved": "https://registry.npm.taobao.org/axios/download/axios-0.19.0.tgz",
+      "resolved": "https://registry.npm.taobao.org/axios/download/axios-0.19.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faxios%2Fdownload%2Faxios-0.19.0.tgz",
       "integrity": "sha1-jgm/89kSLhM/e4EByPvdAO09Krg=",
       "requires": {
         "follow-redirects": "1.5.10",
@@ -547,7 +547,7 @@
       "dependencies": {
         "debug": {
           "version": "3.1.0",
-          "resolved": "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz",
+          "resolved": "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.1.0.tgz",
           "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=",
           "requires": {
             "ms": "2.0.0"
@@ -555,7 +555,7 @@
         },
         "follow-redirects": {
           "version": "1.5.10",
-          "resolved": "http://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.10.tgz",
+          "resolved": "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.10.tgz",
           "integrity": "sha1-e3qfmuov3/NnhqlP9kPtB/T/Xio=",
           "requires": {
             "debug": "=3.1.0"
@@ -563,7 +563,7 @@
         },
         "is-buffer": {
           "version": "2.0.3",
-          "resolved": "http://registry.npm.taobao.org/is-buffer/download/is-buffer-2.0.3.tgz",
+          "resolved": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-2.0.3.tgz",
           "integrity": "sha1-Ts8/z3ScvR5HJonhCaxmJhol5yU="
         }
       }

+ 4 - 1
src/components/task/Task.vue

@@ -387,8 +387,11 @@ export default {
         projectId: this.projectId,
         taskId: this.taskId
       }
-      Http.post(Apis.USER.ACCEPT_TASK, data).then((res) => {
+      Http.put(Apis.USER.ACCEPT_TASK.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId).replace('{userId}', this.user.userVO.id), data).then((res) => {
         console.log(res)
+        this.taskOperationControl = res.taskOperationControl;
+        this.task.status = res.crowdTaskVO.status;
+        this.institution = res.crowdTaskVO.institution;
       })
     },
     submitTaskRequest () {

+ 2 - 2
src/js/api.js

@@ -29,10 +29,10 @@ export default {
     APK: '/api/files/apk/{userId}/',
     UPLOAD_REPORT_FILE: '/api/files/report/{userId}/',
     UPLOAD_EXCEL: '',
-    UPLOAD_IMAGE: '/api/files/image/{userId}/',
+    UPLOAD_IMAGE: '/api/files/image/{userId}/'
   },
   USER: {
-    ACCEPT_TASK: '',
+    ACCEPT_TASK: '/api/project/{projectId}/task/{taskId}/agency/{userId}', // PUT
     ACCEPT_PROJECT: '',
     SUBMIT_TASK_REQUEST: '',
     SUBMIT_PROJECT_REQUEST: '',