2 回答

TA貢獻(xiàn)1854條經(jīng)驗 獲得超8個贊
郵遞員未在請求中發(fā)送 CSRF 令牌,并且您的路由位于web應(yīng)用VerifyCsrfToken 中間件 的路由組下
將您的路線移至api群組或?qū)⑵涮砑訛槔?/p>
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'ddos/store'
];
}

TA貢獻(xiàn)1744條經(jīng)驗 獲得超4個贊
dd在行執(zhí)行之前執(zhí)行了一個中間件。它被稱為CSRF 保護(hù)。您可以通過在app\Http\Middleware\VerifyCsrfToken.
protected $except = [
'/ddos/store',
];
如果您堅持使用郵遞員繼續(xù)發(fā)送 csrf 令牌,您可以創(chuàng)建測試用例并將其保存在環(huán)境變量中(我建議這樣做)。此鏈接可能對您有所幫助。
- 2 回答
- 0 關(guān)注
- 153 瀏覽
添加回答
舉報