擅长:python、mysql、java
<p>下面是我为<a href="http://web2py.com/books/default/chapter/29/09/access-control" rel="nofollow">Customizing Auth</a>找到的一个链接,它解释了如何准确地执行您想要的操作,即使用用户名而不是电子邮件地址进行身份验证。你知道吗</p>
<blockquote>
<p>If you add a field called "username", it will be used in place of
"email" for login. If you do, you will need to add a validator as
well:</p>
<p><code>auth_table.username.requires = IS_NOT_IN_DB(db, auth_table.username)</code></p>
</blockquote>
<p>所以看起来您必须利用链接中讨论的<em><code>define_tables()</code></em>函数。希望这有帮助!你知道吗</p>