第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

來自節(jié)點 js 服務(wù)器的錯誤但不指向任何特定文件

來自節(jié)點 js 服務(wù)器的錯誤但不指向任何特定文件

白板的微信 2021-06-17 15:49:14
我有一個 api 一個域和其他域中的所有其他 api。所以在 SprtsAppConstatnts.js 中,我對所有域進行了硬編碼。當(dāng)我打印然后 formatUrl ---> 存在于 document.js 它打印哪個是正確的域然后 formatUrl ---> http://players.com/run/kit/?id=0900000000009009093292390230923其中 URL ===> 在文件 SportsResUtility.js 中打印出錯誤的域 URL ===> http://sports.com/tes/run/kit/?id=090000000009009093292390230923因為它exports.DATA_DNS_NAME = "http://sports.com";從文件 SprtsAppConstatnts.js 中獲取硬編碼值不確定如何在 SportsResUtility.js 中添加代碼,以便僅針對此路徑添加此域http://players.com我在服務(wù)器日志中顯示了兩個錯誤。不確定它來自哪個文件。 (node:30332) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Can't set headers after they are sent. (node:30332) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.有什么方法可以找出它來自哪個文件。我是否需要安裝任何其他軟件包進行調(diào)試。在下面提供我的代碼片段和沙箱SprtsAppConstatnts.jsexports.GET_JWT_TOKEN_URL = 'https://credentials.com';exports.DATA_DNS_NAME_CONTENT_CENTRAL = "http://players.com";// "http://usersports.com"; // "http://fddfdfdf.main.com:9080";  // dp-rest-apis-urlexports.DATA_DNS_NAME = "http://sports.com"; // "http://fddfdfdf.main.com:9080";  // dp-rest-apis-urlexports.CUST_MICRO_SVC_DNS_NAME = "http://fddfdfdf.main.com";exports.SERVICE_SERVER_DNS_NAME = 'http://sports.com';exports.REST_API_dfdfdfdf_DNS_NAME = 'https://dfdfdfdf.com';SportsResUtility.jsconst axios = require('axios');const SprtsAppConstatnts = require('../../constants/SprtsAppConstatnts');const credentials = require('../../internals/credentials.json');const authUtil = require('./AuthorizationUtil');module.exports ={  callService : (res, url, uri) => {    var formatUrl;    if(uri){       formatUrl = uri + url;    }    else{       formatUrl = SprtsAppConstatnts.DATA_DNS_NAME + url;    }
查看完整描述

2 回答

?
九州編程

TA貢獻(xiàn)1785條經(jīng)驗 獲得超4個贊

(node:30332) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Can't set headers after they are sent.

此錯誤意味著您send()根據(jù)請求進行操作,然后嘗試使用它,就像尚未發(fā)送并再次發(fā)送一樣。

您將變量傳遞resSportsResUtility.callService您調(diào)用的位置res.send(),并且您也調(diào)用res.send()document.js,因此您執(zhí)行了兩次,這是不可能的。


查看完整回答
反對 回復(fù) 2021-06-24
  • 2 回答
  • 0 關(guān)注
  • 154 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號