Apply fixes from StyleCI
This commit is contained in:
parent
4741fa987d
commit
d0609af143
@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Schema;
|
||||
use App\Models\Texture;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
|
@ -233,6 +233,7 @@ class AuthController extends Controller
|
||||
$user = $request->user();
|
||||
$user->email = $email;
|
||||
$user->save();
|
||||
|
||||
return redirect('/user');
|
||||
}
|
||||
|
||||
@ -258,7 +259,7 @@ class AuthController extends Controller
|
||||
{
|
||||
$token = Auth::guard('jwt')->attempt([
|
||||
'email' => $request->email,
|
||||
'password' => $request->password
|
||||
'password' => $request->password,
|
||||
]) ?: '';
|
||||
|
||||
return json(compact('token'));
|
||||
@ -267,6 +268,7 @@ class AuthController extends Controller
|
||||
public function jwtLogout()
|
||||
{
|
||||
Auth::guard('jwt')->logout();
|
||||
|
||||
return response('', 204);
|
||||
}
|
||||
|
||||
|
@ -259,6 +259,7 @@ class SkinlibController extends Controller
|
||||
}
|
||||
|
||||
$texture->delete();
|
||||
|
||||
return json(trans('skinlib.delete.success'), 0);
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ class Kernel extends HttpKernel
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\ForbiddenIE::class,
|
||||
\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class
|
||||
\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
|
@ -13,6 +13,7 @@ class Authenticate extends Middleware
|
||||
'last_requested_path' => $request->path(),
|
||||
'msg' => trans('auth.check.anonymous'),
|
||||
]);
|
||||
|
||||
return '/auth/login';
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,6 @@ namespace App\Http\Middleware;
|
||||
|
||||
use Cookie;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class DetectLanguagePrefer
|
||||
{
|
||||
@ -17,6 +15,7 @@ class DetectLanguagePrefer
|
||||
}
|
||||
app()->setLocale($locale);
|
||||
Cookie::queue('locale', $locale);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ class FireUserAuthenticated
|
||||
if (auth()->check()) {
|
||||
event(new \App\Events\UserAuthenticated($request->user()));
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
@ -13,11 +13,13 @@ class RejectBannedUser
|
||||
if ($request->expectsJson()) {
|
||||
$response = json(trans('auth.check.banned'), -1);
|
||||
$response->setStatusCode(403);
|
||||
|
||||
return $response;
|
||||
} else {
|
||||
abort(403, trans('auth.check.banned'));
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ use Event;
|
||||
use App\Events;
|
||||
use App\Models\User;
|
||||
use ReflectionException;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Redis;
|
||||
use App\Exceptions\PrettyPageException;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
@ -187,7 +187,7 @@ if (! function_exists('bs_copyright')) {
|
||||
'Powered by Blessing Skin Server.',
|
||||
'Proudly powered by Blessing Skin Server.',
|
||||
'由 Blessing Skin Server 强力驱动。',
|
||||
'自豪地采用 Blessing Skin Server。'
|
||||
'自豪地采用 Blessing Skin Server。',
|
||||
],
|
||||
option_localized('copyright_prefer', 0)
|
||||
);
|
||||
|
@ -13,7 +13,7 @@ try {
|
||||
} catch (\Exception $e) {
|
||||
$tips[] = nl2br(implode("\n", [
|
||||
'您需要打开终端或 PowerShell 来执行这条命令:<code>php artisan passport:keys</code>',
|
||||
'You need to open terminal or PowerShell and execute: <code>php artisan passport:keys</code>'
|
||||
'You need to open terminal or PowerShell and execute: <code>php artisan passport:keys</code>',
|
||||
]));
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ Route::group(['prefix' => 'skinlib'], function () {
|
||||
Route::any('/data', 'SkinlibController@getSkinlibFiltered');
|
||||
|
||||
Route::group([
|
||||
'middleware' => ['authorize', 'verified']
|
||||
'middleware' => ['authorize', 'verified'],
|
||||
], function () {
|
||||
Route::get('/upload', 'SkinlibController@upload');
|
||||
Route::post('/upload', 'SkinlibController@handleUpload');
|
||||
|
@ -551,13 +551,13 @@ class AuthControllerTest extends TestCase
|
||||
$this->postJson('/api/auth/login')->assertJson(['token' => false]);
|
||||
$token = $this->postJson('/api/auth/login', [
|
||||
'email' => $user->email,
|
||||
'password' => '12345678'
|
||||
'password' => '12345678',
|
||||
])->decodeResponseJson('token');
|
||||
$this->assertTrue(is_string($token));
|
||||
|
||||
$this->postJson('/api/auth/login', [
|
||||
'email' => $user->email,
|
||||
'password' => '123456789'
|
||||
'password' => '123456789',
|
||||
])->assertJson(['token' => '']);
|
||||
}
|
||||
|
||||
@ -567,11 +567,11 @@ class AuthControllerTest extends TestCase
|
||||
$user->changePassword('12345678');
|
||||
$token = $this->postJson('/api/auth/login', [
|
||||
'email' => $user->email,
|
||||
'password' => '12345678'
|
||||
'password' => '12345678',
|
||||
])->decodeResponseJson('token');
|
||||
|
||||
$this->post('/api/auth/logout', [], [
|
||||
'Authorization' => "Bearer $token"
|
||||
'Authorization' => "Bearer $token",
|
||||
])->assertStatus(204);
|
||||
}
|
||||
|
||||
@ -581,11 +581,11 @@ class AuthControllerTest extends TestCase
|
||||
$user->changePassword('12345678');
|
||||
$token = $this->postJson('/api/auth/login', [
|
||||
'email' => $user->email,
|
||||
'password' => '12345678'
|
||||
'password' => '12345678',
|
||||
])->decodeResponseJson('token');
|
||||
|
||||
$token = $this->postJson('/api/auth/refresh', [], [
|
||||
'Authorization' => "Bearer $token"
|
||||
'Authorization' => "Bearer $token",
|
||||
])->decodeResponseJson('token');
|
||||
$this->assertTrue(is_string($token));
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class ClosetControllerTest extends TestCase
|
||||
'category',
|
||||
'total_pages',
|
||||
'items' => [['tid', 'name', 'type']],
|
||||
]
|
||||
],
|
||||
]);
|
||||
|
||||
// Responsive
|
||||
|
@ -155,6 +155,7 @@ class MiddlewareTest extends TestCase
|
||||
$this->actingAs($user)->get('/user');
|
||||
Event::assertDispatched(\App\Events\UserAuthenticated::class, function ($event) use ($user) {
|
||||
$this->assertEquals($user->uid, $event->user->uid);
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ class PluginControllerTest extends TestCase
|
||||
'name' => 'whatever',
|
||||
]),
|
||||
],
|
||||
]
|
||||
],
|
||||
]);
|
||||
|
||||
// Enable a plugin
|
||||
|
@ -27,7 +27,7 @@ class UserControllerTest extends TestCase
|
||||
'email' => $user->email,
|
||||
'nickname' => $user->nickname,
|
||||
'score' => $user->score,
|
||||
]
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ class UserControllerTest extends TestCase
|
||||
'used' => 0,
|
||||
],
|
||||
'remaining_time' => (int) option('sign_gap_time'),
|
||||
]
|
||||
],
|
||||
]);
|
||||
|
||||
// Remaining time is greater than 0
|
||||
|
Loading…
Reference in New Issue
Block a user