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 {
const { type } = ctx.request.body;
const result = await service.task.fetchCapture({
taskId,
type,
taskType,
type,
});
ctx.success(result);
}
......
/*
* @Descripttion:
* @version:
* @Descripttion:
* @version:
* @Author: jd
* @Date: 2019-12-02 17:25:35
* @LastEditors: jd
* @LastEditTime: 2019-12-03 15:28:31
* @LastEditTime: 2019-12-05 11:19:39
*/
'use strict';
......@@ -24,18 +24,18 @@ class TaskService extends Service {
const { ctx } = this;
let scriptsType = '';
switch (type) {
case 'gjj':
scriptsType = ':18524/gjjfindpwd';
break;
case 'shebao':
scriptsType = ':18523/shebaofindpwd';
break;
case 'incomeTax':
scriptsType = ':18518/gsfindpwd';
break;
default:
ctx.throw(422, { message: '无效的类型' });
break;
case 'gjj':
scriptsType = ':18524/gjjfindpwd';
break;
case 'shebao':
scriptsType = ':18523/shebaofindpwd';
break;
case 'incomeTax':
scriptsType = ':18518/gsfindpwd';
break;
default:
ctx.throw(422, { message: '无效的类型' });
break;
}
return scriptsType;
}
......@@ -74,7 +74,7 @@ class TaskService extends Service {
return result.data.data.taskId;
}
async fetchCapture({ taskId, taskType }) {
async fetchCapture({ taskId, taskType, type }) {
const { taskAPI, ctx } = this;
const { fetchCodeUrl } = taskAPI;
const result = await this._request(this.checkType(type) + fetchCodeUrl, {
......@@ -93,7 +93,7 @@ class TaskService extends Service {
this._checkSuccess(result);
return result.data.data;
}
async submit(data) {
async submit(data, type) {
const { taskAPI, ctx } = this;
const { submitTaskUrl } = taskAPI;
const result = await this._request(this.checkType(type) + submitTaskUrl, {
......@@ -105,7 +105,7 @@ class TaskService extends Service {
this._checkSuccess(result);
return result;
}
async fetchTask(data) {
async fetchTask(data, type) {
const { taskAPI, ctx } = this;
const { fetchTaskUrl } = taskAPI;
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