随着我的角6的客户我访问的http://localhost:8082/login发送username和password并返回一个令牌。这是错误
请注意,下面error:是我想要的令牌。
这是我在Angular上使用的函数,用于使用给定的用户名和密码获取令牌
validateUser(user:User){
var reqHeader = new HttpHeaders({ 'Content-Type': 'application/json','No-Auth':'True' });
return this.httpClient.post<User>(this.apiURL + '/login',user,{headers:reqHeader});
}
Run Code Online (Sandbox Code Playgroud)
我只想返回令牌,就像在邮递员中一样。我试过了,toPromise()但是有更多错误。