이전의 이온 응용 프로그램과 동일한 API를 사용하는 Ionic 3 응용 프로그램이 있습니다.URL의 상태가 0 인 응답 : null
로깅에것은 지금 다음 오류 점점 오전에 내 API는 일 나는 주위를 검토 한 결과 모두가 서버 측에서 CORS 문제를 참조 유지
Response with status: 0 for URL: null
을,이 경우 수 없습니다 기존 응용 프로그램에서는 이전과 동일합니다.
login(credentials) {
return new Promise((resolve, reject) => {
this.http.post(this.global.base() + 'login', JSON.stringify(credentials), { headers: this.contentHeader })
.subscribe(res => {
resolve(res.json());
}, (err) => {
reject(err);
});
});
}
내 구성 XML (그림에 대한 손질) :
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<plugin name="cordova-plugin-device" spec="^1.1.4" />
<plugin name="cordova-plugin-ionic-webview" spec="^1.1.16" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="cordova-sms-plugin" spec="^0.1.11" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<engine name="ios" spec="~4.4.0" />
내 index.html을 :
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#4e8ef7">
<!-- add to homescreen for ios -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
내 설정 :
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.14.0
ionic (Ionic CLI) : 3.14.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
@ionic/app-scripts : 3.0.1
Cordova Platforms : ios 4.4.0
Ionic Framework : ionic-angular 3.7.1
System:
ios-deploy : 1.9.2
Node : v7.7.1
npm : 4.1.2
OS : macOS Sierra
Xcode : Xcode 9.0.1 Build version 9A1004
Misc:
backend : legacy
여기
내 로그인입니다
누구나 올바른 방향으로 나를 가리킬 수 있습니까?