gpt4 book ai didi

angular - Chrome' Cross-Origin Read Blocking (CORB) blocked cross-origin response' ionic

转载 作者:行者123 更新时间:2023-12-04 23:05:16 29 4
gpt4 key购买 nike

我正在尝试对用户进行身份验证,但由于Cross-Origin Read Blocking (CORB) blocked 问题我的 login.ts 代码是

if (this.plugins.isOnline()) {
if (this.wait == true) {
return;
} else if (this.userLogin.email == '' || this.userLogin.password == '') {
this.utility.doToast("Please don't leave any field blank.");
return;
} else {
this.wait = true;
this.auth.login(this.userLogin).subscribe((success) => {
this.wait = false;
console.log(success.successData);
this.credential.setUser(success.successData);
this.plugins.sendTags(success.successData.id)
this.rememberUsertype(success.successData.is_celebrity);
if(success.successData.is_celebrity == '0'){
this.app.getRootNav().setRoot("HomePage");
}
else if(success.successData.is_celebrity == '1'){
this.app.getRootNav().setRoot("DashboardPage");
}

}, (error) => {
console.log(error);
this.wait = false;
if (this.utility.timeOutResponse(error))
this.utility.doToast("The email or password you entered is incorrect.")
})
}
} else {
this.utility.doToast(this.utility.internetConnectionMessage());
}

this.auth.login 函数

login(params) {
console.log(params);
var url = this.constants.API_ENDPOINT + 'login';
var response = this.http.post(url, params, {}).map(res => res.json());
return response;
}

最佳答案

允许控制允许来源:允许您从任何来源请求带有 ajax 的任何站点。添加到响应“Allow-Control-Allow-Origin: *” header

在您的浏览器中添加此扩展程序:Allow-Control-Allow-Origin

关于angular - Chrome' Cross-Origin Read Blocking (CORB) blocked cross-origin response' ionic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54768026/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com