diff --git a/app/Http/Controllers/Web/AuthController.php b/app/Http/Controllers/Web/AuthController.php index 6c05a02..d9ea0dc 100644 --- a/app/Http/Controllers/Web/AuthController.php +++ b/app/Http/Controllers/Web/AuthController.php @@ -28,12 +28,12 @@ public function index(Request $request): View|RedirectResponse session(['callback' => $callback]); - if (Auth::guard('web')->check()) { + if ($request->user('web')) { $callbackHost = parse_url($callback, PHP_URL_HOST); $dashboardHost = parse_url(config('settings.dashboard.base_url'), PHP_URL_HOST); if ($callbackHost === $dashboardHost) { - if (! Auth::guard('web')->user()->isRealNamed()) { + if (! $request->user('web')->isRealNamed()) { return redirect()->route('real_name.create')->with('status', '重定向已被打断,需要先实人认证。'); } @@ -51,7 +51,7 @@ public function index(Request $request): View|RedirectResponse } } - return view('index'); + return $request->user('web') ? view('index') : view('welcome'); } public function confirm_redirect(Request $request): View diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 52f3741..ac6c329 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -2,108 +2,95 @@ @section('content') - @guest -

欢迎使用 {{ config('app.display_name') }}

-

您需要先 登录 / 注册,才能继续使用 {{ config('app.display_name') }}。

- -

如果您继续,则代表您已经阅读并同意 服务条款

- 登录 - 注册 - @endguest - - @auth - @if(!auth('web')->user()->isRealNamed()) - -
- 您还没有实人认证实人认证后才能使用所有功能。 -
-
- @endif - - @if (session('token')) - -
- 像密码一样保管好您的 API Token。 -
- {{ session('token') }} -
-
- @endif - - -

嗨, {{ auth('web')->user()->name }}

- @php($user = auth('web')->user()) -
- @csrf - @method('PATCH') -
- - + @if(!auth('web')->user()->isRealNamed()) + +
+ 您还没有实人认证实人认证后才能使用所有功能。
+
+ @endif - - - -

访问密钥

-

在这里,你可以获取新的 Token 来对接其他应用程序或者访问 控制面板。

- -
- @csrf -
- - + @if (session('token')) + +
+ 像密码一样保管好您的 API Token。 +
+ {{ session('token') }}
- - - - -

撤销密钥

-

如果你需要撤销对所有应用程序的授权,你可以在这里吊销所有 Token

-
- @csrf - @method('DELETE') - -
+
+ @endif -