0
我这样使用HTTP:角2饼干未设置
private headers = new Headers({ 'Content-Type': 'application/json' })
login(loginUser: LoginUser): Promise<User> {
return this.http.post('http://localhost:9009/api/users/login', JSON.stringify(loginUser), { headers: this.headers })
.toPromise()
.then(res => res.json())
.catch(this.handleError)
}
这应该自动设置的cookie到浏览器,像这样:
但没有cookie的浏览器设置。
- 角版本:2.4.10
- 浏览器:Chrome浏览器56.0.2924.87(64位)|火狐52.0.2(64位)
- 语言:打字稿2.2.1
- 节点(AOT问题):节点--version = 3.10.10
响应标头:
没有cookie烘烤。 –
谢谢,我通过设置withCredentials = true来解决它 – ws2823147532