Route::get('/', function (IlluminateHttpRequest $request) {
dd(Auth::basic(),Auth::onceBasic(),$request->cookie(),$request->session(),Auth::id(),Auth::check(),Auth::user());
})->middleware('auth.basic.once');
Route::get('/base', function (IlluminateHttpRequest $request) {
dd($request->cookie(),$request->session(),Auth::id(),Auth::check(),Auth::user());
})->middleware('auth.basic.once');
如上我的代码,auth.basic.once和auth.basic互相替换了一次,我作为用户操作时,感觉没区别啊,都只是登录一次,/和/base就都能访问了。
官方文档如下,http://d.laravel-china.org/do...
Route::get('api/user', function () {
})->middleware('auth.basic.once');
Route::get('api/user', function () {
})->middleware('auth.basic');
又谁能说下具体用法吗
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…