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

《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
最佳答案

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

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

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

5年前 评论
@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

5年前 评论

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

5年前 评论

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

5年前 评论
JasonLi

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

5年前 评论

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

3年前 评论

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