lararel 5.5 {{ csrf_field () }} 加上这个验证, 再次点击注册还是上个页面报的错误, 请问如何解决?

《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
最佳答案

嗯嗯,已经修改好了, 是环境的问题造成的

7年前 评论
讨论数量: 8
JasonG

请贴上相关的代码以及报错的内容,这样没法帮助你

7年前 评论
@extends('layouts.default')
@section('title', '注册')

@section('content')
    <div class="col-md-offset-2 col-md-8">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h5>注册</h5>
            </div>
            <div class="panel-body">
                @include('shared._errors')

                <form method="POST" action="{{ route('users.store') }}">
                        {{ csrf_field() }}

                    <div class="form-group">
                        <label for="name">名称:</label>
                        <input type="text" name="name" class="form-control" value="{{ old('name') }}">
                    </div>

                    <div class="form-group">
                        <label for="email">邮箱:</label>
                        <input type="text" name="email" class="form-control" value="{{ old('email') }}">
                    </div>

                    <div class="form-group">
                        <label for="password">密码:</label>
                        <input type="password" name="password" class="form-control" value="{{ old('password') }}">
                    </div>

                    <div class="form-group">
                        <label for="password_confirmation">确认密码:</label>
                        <input type="password" name="password_confirmation" class="form-control" value="{{ old('password_confirmation') }}">
                    </div>

                    <button type="submit" class="btn btn-primary">注册</button>
                </form>
            </div>
        </div>
    </div>
[@stop](https://learnku.com/users/14763)

file

7年前 评论

你添加{{ csrf_field() }},刷新页面了吗?

7年前 评论

嗯嗯,已经修改好了, 是环境的问题造成的

7年前 评论
JasonLi

需要清除一下页面的缓存cookie XSRF-TOKEN,重新提交就好了

6年前 评论

@CSRF 比 {{ csrf_field() }} 简捷

5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!