【问题标题】:Forgot password UI is not working properly in laravel忘记密码 UI 在 laravel 中无法正常工作
【发布时间】:2019-10-12 19:33:36
【问题描述】:

我正在使用 laravel 默认身份验证,我的忘记密码页面 UI 无法正常工作,可能 JS 或 CSS 文件中缺少某些内容:

这是我的 ForgotPassword 的 HTML 视图,默认情况下 laravel 我们使用 @extends(layouts.app) 和 @section('content') 但事情无法正常工作,您需要这里的帮助。

              @extends('layouts.app')
           @section('content')
        <div class="container">
       <div class="row">
    <div class="col-md-8 col-md-offset-2">
        <div class="panel panel-default">
                <div class="container">
                    <div class="row">
                        <div class="col-md-8 col-md-offset-2">
                            <div class="panel panel-default">

            <div class="panel-heading">Reset Password</div>

                                <div class="panel-body">
                <form class="form-horizontal" method="POST" action="{{ route('password.request') }}">
                    {{ csrf_field() }}

                    <input type="hidden" name="token" value="{{ $token }}">

                    <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
                        <label for="email" class="col-md-4 control-label">E-Mail Address</label>

                        <div class="col-md-6">
                            <input id="email" type="email" class="form-control" name="email" value="{{ $email or old('email') }}" required autofocus>

                            @if ($errors->has('email'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('email') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
                        <label for="password" class="col-md-4 control-label">Password</label>

                        <div class="col-md-6">
                            <input id="password" type="password" class="form-control" name="password" required>

                            @if ($errors->has('password'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('password') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>


                    <div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
                        <label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>
                        <div class="col-md-6">
                            <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>

                            @if ($errors->has('password_confirmation'))
                                <span class="help-block">
                <strong>{{ $errors->first('password_confirmation') }}</strong>
            </span>
                            @endif
                        </div>
                    </div>


                            @if ($errors->has('password_confirmation'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('password_confirmation') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-4">
                            <button type="submit" class="btn btn-primary">
                                Reset Password
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

@endsection

我不知道这里出了什么问题,我还附上了我的页面 UI 的屏幕截图。

【问题讨论】:

    标签: javascript css laravel user-interface forgot-password


    【解决方案1】:

    请检查 Chrome 开发工具(或类似工具)中的“网络”标签。您应该会发现app.css 文件没有加载,您应该调试该错误。

    还请确保在您的resources/views/layouts/app.blade.php 文件中,.css 文件已加载到页面头部的某处。并确保该文件存在于您项目的public 目录中。

    【讨论】:

    • .css文件在head下,css/app.css和js/ap.css在css和js文件夹下的public文件夹下
    • @syed1234 可以分享一下加载css的部分代码吗?
    • 您在子目录 feature-master 中运行您的应用程序,并且您可能包含 http://localhost/css/app.css 这将不起作用,因为它应该是 feature-master/css/app.css
    猜你喜欢
    • 2022-06-23
    • 1970-01-01
    • 2021-01-06
    • 1970-01-01
    • 2018-03-27
    • 1970-01-01
    • 2014-10-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多