我在重置密码时有一个奇怪的行为。我安装在 dev fosuser 包上。我覆盖了登录模板,它工作正常。但重置路线不能正常工作。我的配置:
swiftmailer:
transport: gmail
username: myEmail@gmail.com
password: passowrd
spool: { type: memory }
fos_user:
db_driver: orm
user_class: App\DesktopBundle\Entity\User
firewall_name: main
service:
mailer: fos_user.mailer.twig_swift
resetting:
token_ttl: 86400 # change this value, it is in seconds = 24 hours
email:
template: email/password_resetting.email.twig
from_email:
address: noreply@acmedemo.com
sender_name: Title Email
我创建了一个文件:/app/Resources/FOSUserBundle/views/Resetting/request.html.twig
<div class="row">
<div class="col-md-3 col-sm-3">
</div>
<div class="col-md-5 col-sm-5" style="margin-top: 3%">
<div class="title-area" style="margin-bottom: 2%;">
<h2 class="title">Reset</h2>
<span class="line"></span>
</div>
<form action="{{ path('fos_user_resetting_check_email') }}" method="POST" class="comments-form contact-form">
<div>
{% if invalid_username is defined %}
<p>{{ 'resetting.request.invalid_username'|trans({'%username%': invalid_username}) }}</p>
{% endif %}
<div class="input-group" style="margin-bottom: 2%;">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input class="form-control" placeholder="Login" type="text" id="username" name="username" required="required" style="height: 55px;font-size: 20px;">
</div>
</div>
<div>
<input type="submit" value="Reset" class="btn btn-lg btn-primary btn-block"/>
</div>
</form>
</div>
<div class="col-md-3 col-sm-3">
<div class="right-bloc-pub" style="width:300px; height: 600px; background:red; margin-top:13%;">
</div>
</div>
</div>
当我按下提交按钮时,我被重定向到 url:/resetting/check-email
和错误: No route found for "POST /resetting/check-email": Method Not Allowed (Allow: GET, HEAD)
。而且我没有收到电子邮件。你能帮我吗 ?对不起我的英语不好