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

解决报错

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