【发布时间】:2019-03-14 17:57:40
【问题描述】:
在任何注册后,我都会推动用户验证他的帐户。我将验证码发送到他的电子邮件,他将其添加到输入中并通过发布 API 调用发送该值。 我的问题是,当我提出请求时,我得到了 203 Non-Authoritative Information 的响应。但是当我用 PostMan 尝试这个过程时,它工作得很好
我的组件代码:
verfiy(){
this.code = this.userverfiycode.verfiCode;
this.authService.postData('Verify?userId='+this.user +'&vCode='+ this.code ).then((result) => {
this.responseData = result;
console.log(this.responseData);
console.log(this.user);
console.log(this.code);
console.log(this.type);
if (this.responseData = true) {
this.pushpage()
}
else{
console.log("");
}
}, (err) => {
// Error log
});
}
我的提供者代码:
let apiUrl = 'http://localhost:50494/api/Account/';
let apiKey = 'sdf4rw-23fs-3454-fsdsd-3we2693243424';
@Injectable()
export class AuthProvider {
constructor(public http : Http) {
console.log('Hello AuthService Provider');
}
UserKey = localStorage.getItem('loginData');
postData( type) {
return new Promise((resolve, reject) => {
let headers = new Headers();
headers.append('Content-Type', 'application/json');
headers.append('token', apiKey);
headers.append('api_key', this.UserKey);
this.http.post(apiUrl + type, {headers: headers})
.subscribe(res => {
resolve();
console.log()
}, (err) => {
reject(err);
console.log()
});
});
}
【问题讨论】:
-
你也可以在这里发布邮政编码
-
帖子数据中没有正文。这是正确的吗?
-
我只想在 Url 中发送参数
标签: angular api ionic-framework ionic3