人生就是挖坑埋自己

1050 经验值

你说的对了,就是这个值为空 . 我试了window.localStorage.getItem(‘token’) 不行,需要在
jwt.js文件把
getToken(){

     return window.localStorage.getItem('jwt_token');
},

加个return

我把api文件的这个
Route::middleware('api')->get('/user', function (Request $request) {

return $request ->user();};  能通过了,但是获取不到email 和用户名

actions:{

    setAuthUser({commit,dispatch}){
        axios.get('/api/user').then(response =>{
            commit({
                type:types.SET_AUTH_USER,
                user:response.data
                
            })
            console.log(874);
        })

    }

这个api 访问不了啊

message: "curl_setopt_array(): Unable to create temporary file.", exception: "ErrorException",…}
exception
:
"ErrorException"
file
:
"D:\codeing\VueSPA\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php"
line
:
57
message
:
"curl_setopt_array(): Unable to create temporary file."
trace
:
[{function: "handleError", class: "Illuminate\Foundation\Bootstrap\HandleExceptions", type: "->"},…]    Error: Request failed with status code 500
    at createError (app.js:1330)
    at settle (app.js:34107)
    at XMLHttpRequest.handleLoad (app.js:1204)

这个错误是什么意思,站长?

为啥好多手机浏览器不能看?