Commit cf8b2060 authored by 姜登's avatar 姜登

type

parent 3a1c05b9
Pipeline #17849 passed with stage
in 3 seconds
...@@ -106,8 +106,8 @@ class TaskController extends Controller { ...@@ -106,8 +106,8 @@ class TaskController extends Controller {
const { type } = ctx.request.body; const { type } = ctx.request.body;
const result = await service.task.fetchCapture({ const result = await service.task.fetchCapture({
taskId, taskId,
type,
taskType, taskType,
type,
}); });
ctx.success(result); ctx.success(result);
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: jd * @Author: jd
* @Date: 2019-12-02 17:25:35 * @Date: 2019-12-02 17:25:35
* @LastEditors: jd * @LastEditors: jd
* @LastEditTime: 2019-12-03 15:28:31 * @LastEditTime: 2019-12-05 11:19:39
*/ */
'use strict'; 'use strict';
...@@ -74,7 +74,7 @@ class TaskService extends Service { ...@@ -74,7 +74,7 @@ class TaskService extends Service {
return result.data.data.taskId; return result.data.data.taskId;
} }
async fetchCapture({ taskId, taskType }) { async fetchCapture({ taskId, taskType, type }) {
const { taskAPI, ctx } = this; const { taskAPI, ctx } = this;
const { fetchCodeUrl } = taskAPI; const { fetchCodeUrl } = taskAPI;
const result = await this._request(this.checkType(type) + fetchCodeUrl, { const result = await this._request(this.checkType(type) + fetchCodeUrl, {
...@@ -93,7 +93,7 @@ class TaskService extends Service { ...@@ -93,7 +93,7 @@ class TaskService extends Service {
this._checkSuccess(result); this._checkSuccess(result);
return result.data.data; return result.data.data;
} }
async submit(data) { async submit(data, type) {
const { taskAPI, ctx } = this; const { taskAPI, ctx } = this;
const { submitTaskUrl } = taskAPI; const { submitTaskUrl } = taskAPI;
const result = await this._request(this.checkType(type) + submitTaskUrl, { const result = await this._request(this.checkType(type) + submitTaskUrl, {
...@@ -105,7 +105,7 @@ class TaskService extends Service { ...@@ -105,7 +105,7 @@ class TaskService extends Service {
this._checkSuccess(result); this._checkSuccess(result);
return result; return result;
} }
async fetchTask(data) { async fetchTask(data, type) {
const { taskAPI, ctx } = this; const { taskAPI, ctx } = this;
const { fetchTaskUrl } = taskAPI; const { fetchTaskUrl } = taskAPI;
const result = await this._request(this.checkType(type) + fetchTaskUrl, { const result = await this._request(this.checkType(type) + fetchTaskUrl, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment