2017-05-15 133 views
1

我正在使用asp.net核心與樣板框架。在執行保存功能時,我收到「發生錯誤!服務器未發送錯誤詳細信息。」生產服務器上的錯誤。在調試時,我發現控件得到.fail()函數,而不是去.done()函數。記錄被保存到數據庫中,我彈出如下消息:「發生了錯誤!服務器未發送錯誤詳細信息。」發生了錯誤!服務器發送錯誤詳細信息

以下是使用jQuery的:

this.save = function (modalManager) { 
      debugger; 
      _$Form = _modalManager.getModal().find('form[name=FormName]'); 
      var orderTemplateId = $("#orderTemplateId").val(); 
      var OrderTemplate = _$Form.serializeFormToObject(); 
      _modalManager.setBusy(true); 
      debugger; 

      OrderTemplate.id = orderTemplateId; 
      var AssignedProductsIds = _findAssignedProductList(); 
      debugger; 
      _orderTemplateService.createOrUpdateOrderTemplate({ 
       OrderTemplate: OrderTemplate, 
       AssignedProductsIds: AssignedProductsIds, 
      }).done(function (result) { 
       debugger; 
       abp.notify.info(app.localize('SavedSuccessfully')); 
       _modalManager.close();     
      }).fail(function (result) { 
       debugger;      
       _modalManager.close(); 
      }).always(function (result) { 
       _modalManager.setBusy(false); 
       window.location.href = '/app/zone'; 
      });    
     }; 

的功能完美的作品本地服務器上沒有任何錯誤。那麼,我沒有得到我錯誤的地方?

謝謝。

+2

檢查瀏覽器中的控制檯。它至少會爲您提供可用於調試問題的HTTP響應代碼 –

+1

您是否查看了日誌文件? –

+0

abp的版本? – andmattia

回答

1

在OrderTemplateAppService> CreateOrUpdateOrderTemplate()方法中,您應該返回一個輸出類。在所有情況下,你必須返回輸出類。因此,根據您的輸入數據,它可能會行爲不端。

這是一個示例輸出什麼客戶希望:

 
{ 
    "success": true, 
    "result": { 
     "form": {  
      "formNo": "YYYYYY", 
      "serial": "XXXX", 
      "productGroup": { 
       "name": "LAPTOP"     
      },      
      "lastModificationTime": "2017-06-20T17:29:13.94", 
      "id": 48961 
     } 
    }, 
    "error": null, 
    "unAuthorizedRequest": false 
} 

檢查從Chrome的控制檯你的方法的原始響應,如果你還沒有加入「成功」字段的輸出,大概框架的行爲,因爲這方法沒有成功

0

你可以在Logs.txt得到錯誤的詳細信息。

相關問題