我最近在laravel中启动了一个新项目。
一切都进行得很好,但是我遇到了一个问题。
我在项目中设置了laravel的内置身份验证。
我有一个忘记密码链接,可以通过电子邮件发送重置密码链接。
每当我打开该链接时,用于密码重置的自定义视图都会无限次呈现。
代码:
@extends('layouts.app')
@section('content')
<div class="middle-box text-center loginscreen animated fadeInDown">
<div>
<div>
<h1 class="logo-name">ABC</h1>
</div>
<h3>Welcome to ABC Admin</h3>
<p>Reset your password.</p>
<form class="m-t" role="form" method="POST" action="{{ route('password.request') }}">
@if (session('status'))
<div class="alert alert-success">
{{ session('status') }}
</div>
@endif
{{ csrf_field() }}
<input type="hidden" name="token" value="{{ $token }}">
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<input id="email" type="email" class="form-control" placeholder="Email" name="email" value="{{ old('email') }}" required autofocus>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<input id="password" type="password" class="form-control" placeholder="Password" name="password" required>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<input id="password-confirm" type="password" class="form-control" placeholder="Confirm Password" name="password_confirmation" required>
@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif
</div>
<button type="submit" class="btn btn-primary block full-width m-b">Reset Password</button>
</form>
<p class="m-t"> <small>© Copyright {{ date('Y') }}. All rights reserved by ABC.</small> </p>
</div>
</div>
@endsection
答案 0 :(得分:0)
我已经解决了它,因为模板中有一个js文件 包含代码以包含无法包含的演示html文件。 该js错误会导致整个问题。谢谢您 @IamCavic 。