Адрес внешнего интерфейса добавляется в baseurl в angular js и показывает ошибку «Не найдено» 404 - PullRequest
0 голосов
/ 15 января 2020

hlw, мой базовый URL-адрес такой,

export const environment = {
  production: false,
  baseUrl:"'http://localhost:9002"

};

Но он не попадает в API и не показывает ошибку, вот так

zone-evergreen.js:2952 POST http://localhost:4200/'http://localhost:9002/rest/v1/login/ 404 (Not Found)
scheduleTask @ zone-evergreen.js:2952
scheduleTask @ zone-evergreen.js:378
onScheduleTask @ zone-evergreen.js:272
scheduleTask @ zone-evergreen.js:372
scheduleTask @ zone-evergreen.js:211
scheduleMacroTask @ zone-evergreen.js:234
scheduleMacroTaskWithCurrentZone @ zone-evergreen.js:1107
(anonymous) @ zone-evergreen.js:2985
proto.<computed> @ zone-evergreen.js:1428
(anonymous) @ http.js:2581
_trySubscribe @ Observable.js:42
subscribe @ Observable.js:28
(anonymous) @ subscribeTo.js:20
subscribeToResult @ subscribeToResult.js:7
_innerSub @ mergeMap.js:59
_tryNext @ mergeMap.js:53
_next @ mergeMap.js:36
next @ Subscriber.js:49
(anonymous) @ scalar.js:4
_trySubscribe @ Observable.js:42
subscribe @ Observable.js:28
call @ mergeMap.js:21
subscribe @ Observable.js:23
call @ filter.js:13
subscribe @ Observable.js:23
call @ map.js:16
subscribe @ Observable.js:23
login @ login.component.ts:41
eval @ LoginComponent.html:26
handleEvent @ core.js:43993
callWithDebugContext @ core.js:45632
debugHandleEvent @ core.js:45247
dispatchEvent @ core.js:29804
(anonymous) @ core.js:42925
(anonymous) @ platform-browser.js:2668
invokeTask @ zone-evergreen.js:391
onInvokeTask @ core.js:39680
invokeTask @ zone-evergreen.js:390
runTask @ zone-evergreen.js:168
invokeTask @ zone-evergreen.js:465
invokeTask @ zone-evergreen.js:1603
globalZoneAwareCallback

@ zone-evergreen. js: 1629 Показать еще 12 кадров login.component.ts: 53 loginErr

Я действительно не знаю, почему это происходит, пожалуйста, помогите мне

1 Ответ

0 голосов
/ 15 января 2020

API-адрес неверен. это добавляет http://localhost:4200/ дважды.

Проверьте вызов API, куда вы добавляете url.

http://localhost:4200/'http://localhost:9002/rest/v1/login/ 404 (Not Found)

...