提交 16103e93 编写于 作者: KK's avatar KK

解决报错

上级 31b8a7ae
......@@ -35,13 +35,13 @@ export class CalendarServiceBase extends MdServiceBase {
if (serviceName) {
const service: any = await this.getService(serviceName);
const response: HttpResponse = await service[action](context, data);
if (response.isError()) {
if (response.isError && response.isError()) {
return Promise.reject(response);
}
return this.formatItem(response, calendarItem);
}
const response: HttpResponse = await this.service[action](context, data);
if (response.isError()) {
if (response.isError && response.isError()) {
return Promise.reject(response);
}
return this.formatItem(response, calendarItem);
......
......@@ -176,7 +176,7 @@ export class ControlServiceBase {
} else {
response = await this.service.Create(context, data);
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response);
}
await this.onAfterAction(action, context, response);
......@@ -202,7 +202,7 @@ export class ControlServiceBase {
} else {
response = await this.service.Remove(context, data);
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response);
}
await this.onAfterAction(action, context, response);
......@@ -228,7 +228,7 @@ export class ControlServiceBase {
} else {
response = await this.service.Update(context, data);
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response);
}
await this.onAfterAction(action, context, response);
......@@ -254,7 +254,7 @@ export class ControlServiceBase {
} else {
response = await this.service.Get(context, data);
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response);
}
await this.onAfterAction(action, context, response);
......@@ -283,7 +283,7 @@ export class ControlServiceBase {
} else {
response = await this.service.GetDraft(context, data);
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response, true);
this.mergeDefaults(response);
}
......@@ -310,7 +310,7 @@ export class ControlServiceBase {
} else {
response = new HttpResponse(200, null, { code: 100, message: `${action}前台逻辑未实现` });
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response, true);
}
await this.onAfterAction(action, context, response);
......
......@@ -29,7 +29,7 @@ export class DataViewServiceBase extends ControlServiceBase {
} else {
response = await this.service.FetchDefault(context, data);
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response);
}
await this.onAfterAction(action, context, response);
......
......@@ -44,7 +44,7 @@ export class FormServiceBase extends ControlServiceBase {
} else {
response = await this.service.Create(context, data);
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response);
}
await this.onAfterAction(action, context, response);
......@@ -71,7 +71,7 @@ export class FormServiceBase extends ControlServiceBase {
} else {
response = await this.service.WFSubmit(context, data, wfdata);
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response);
}
await this.onAfterAction(action, context, response);
......
......@@ -29,7 +29,7 @@ export class MdServiceBase extends ControlServiceBase {
} else {
response = await this.service.FetchDefault(context, data);
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response);
}
await this.onAfterAction(action, context, response);
......
......@@ -29,7 +29,7 @@ export class WizardPanelServiceBase extends ControlServiceBase {
} else {
response = await this.service.Create(context, data);
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response);
}
await this.onAfterAction(action, context, response);
......@@ -55,7 +55,7 @@ export class WizardPanelServiceBase extends ControlServiceBase {
} else {
response = await this.service.Update(context, data);
}
if (!response.isError()) {
if (!response.isError && response.isError()) {
response = this.handleResponse(action, response);
}
await this.onAfterAction(action, context, response);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册