1

据我所知,在 Laravel 的后端一切正常,因为它在 Postman 中运行良好,但是当我尝试从前端(Angular 4)验证令牌时,JWT-Auth 抛出错误{"error":"token_not_provided"} 这就是我的请求标头的样子.

POST /api/user HTTP/1.1
Accept:          application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7
Connection:      keep-alive
Content-Length:  439
Content-Type:    application/json
Host:            localhost:8000
Origin:          http://localhost:4200
Referer:         http://localhost:4200/
User-Agent:      Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36(KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36

{
    "header": {
        "Content-type": "application/json",
        "Authorization": "Bearer eyJ0eXAiOiJKV .... vBMbwBypj6uv4Ks",
        "Accept": "application/json;odata=verbose"
    }
}
4

0 回答 0