jelly老师,我在TokenProxy.php里面的logout方法里写了两句代码,主要想试试把这个$user变量通过json返回来看看里面的值
public function logout(){
$user = auth()->guard('api')->user();
return response()->json(['user' => $user]);
}
但是response 返回的却是一堆html元素,这是为什么呢?
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="tra4fG6QHSkDTPErjCTRNkODvXCD3hg1O5CwXzqx">
<title>Laravel SPA</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/css/app.css">
</head>
<body>
<div id="app">
<app></app>
</div>
<script src="/js/app.js"></script>
</body>
</html>
@jellybool