phpcms 实现用户名和邮件均可登录

 
第一步:修改登陆的验证JS
  修改 statics/js/formvalidatorregex.js找到
 
ps_username:”^[u4E00-u9FA5uF900-uFA2D_w]+$”
改成
ps_username:”^[\\u4E00-\\u9FA5\\uF900-\\uFA2D_\\w@\.]+$”

第二步: 修改登录文件
     修改 phpcms/modules/member/index.php
 
将 $status = $this->client->ps_member_login($username, $password);

改为
if(is_email($username)){
$status = $this->client->ps_member_login($username, $password,1);
} else {
$status = $this->client->ps_member_login($username, $password);
}

 

0 个评论

要回复文章请先登录注册