用户支持登录登出

This commit is contained in:
2022-08-07 13:13:10 +08:00
parent cca0958899
commit d07cad1cd8
15 changed files with 402 additions and 7 deletions

View File

@ -6,5 +6,13 @@
<a class="text-blue-600 underline" href="/comments">节目单查询</a>
<a class="text-blue-600 underline" href="/danmakus">直播弹幕查询</a>
<a class="text-blue-600 underline" href="/programs" title="数据不全,待补充">节目查询</a>
@auth
<a class="text-blue-600 underline" href="/programs/construct">节目建设</a>
<a class="text-blue-600 underline float-right" href="{{ route("logout") }}">登出</a>
<div class="float-right text-cyan-300 mx-2 border bg-blue-600">{{ Auth::user()->name }}</div>
@endauth
@guest
<a class="text-blue-600 underline float-right" href="{{ route("login") }}">登录</a>
@endguest
</div>
</div>

View File

@ -11,7 +11,7 @@
<input type="hidden" name="id" value="{{$program_video->id}}">
<label class="block my-2">
BVID
<input class="form-input border-0 border-b-2 w-full" @if($program_video->video_bvid) disabled @endif type="text" name="video_bvid" value="{{ old("video_bvid", $program_video->video_bvid) }}">
<input class="form-input border-0 border-b-2 w-full" @disabled($program_video->video_bvid) type="text" name="video_bvid" value="{{ old("video_bvid", $program_video->video_bvid) }}">
</label>
<label class="block my-2">
开始P数

View File

@ -0,0 +1,35 @@
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>登录</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="{{ mix('/css/app.css') }}" rel="stylesheet"/>
</head>
<body>
@include("common.header")
<form class="w-full lg:w-1/2 border-2 mx-auto my-2" action="" method="post" enctype="multipart/form-data">
<div class="block text-lg font-bold ml-4 mt-2">登录</div>
<label class="block my-2">
用户名
<input class="form-input border-0 border-b-2 w-full" type="text" name="username" value="{{ old("username") }}" placeholder="用户名或邮箱">
</label>
<label class="block my-2">
密码
<input class="form-input border-0 border-b-2 w-full" type="password" name="password" value="{{ old("password") }}" placeholder="密码">
</label>
<label class="block my-4">
记住密码
<input class="form-checkbox" type="checkbox" name="remember" @checked(old("remember") == 1) value="1">
</label>
@if($errors->any())
@foreach ($errors->all() as $error)
<div class="bg-red-600 text-white">错误:{{ $error }}</div>
@endforeach
@endif
<div class="block my-2 text-center">
<input class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" type="submit" value="登录">
</div>
</form>
@include("common.footer")
</body>
</html>

View File

@ -0,0 +1,35 @@
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>注册</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="{{ mix('/css/app.css') }}" rel="stylesheet"/>
</head>
<body>
@include("common.header")
<form class="w-full lg:w-1/2 border-2 mx-auto my-2" action="" method="post" enctype="multipart/form-data">
<div class="block text-lg font-bold ml-4 mt-2">登录</div>
<label class="block my-2">
用户名
<input class="form-input border-0 border-b-2 w-full" type="text" name="name" value="{{ old("name") }}" placeholder="用户名">
</label>
<label class="block my-2">
邮箱
<input class="form-input border-0 border-b-2 w-full" type="email" name="email" value="{{ old("email") }}" placeholder="邮箱">
</label>
<label class="block my-2">
密码
<input class="form-input border-0 border-b-2 w-full" minlength="5" type="password" name="password" value="{{ old("password") }}" placeholder="密码">
</label>
@if($errors->any())
@foreach ($errors->all() as $error)
<div class="bg-red-600 text-white">错误:{{ $error }}</div>
@endforeach
@endif
<div class="block my-2 text-center">
<input class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" type="submit" value="注册">
</div>
</form>
@include("common.footer")
</body>
</html>