master
elf 8 months ago
parent 83616c37ff
commit 33a3179405

@ -793,16 +793,23 @@ class MemberController extends ThinkController
public function changeprelname()
{
if (preg_match('/^([\xe4-\xe9][\x80-\xbf]{2}){2,4}$/', $_POST['real_name'])) {
$realName = trim($_POST['real_name']);
if (strpos($realName, '·') === false) {
if (!preg_match('/^([\xe4-\xe9][\x80-\xbf]{2}){2,4}$/', $realName)) {
$this->ajaxReturn(array("status" => 0, "msg" => "真实姓名输入错误"));
return;
}
}
//重复判断
$map['id'] = $_POST['id'];
$pro = M("User", "tab_")
->where($map)
->setField('real_name', $_POST['real_name']);
->setField('real_name', $realName);
if ($pro !== false) {
addOperationLog(array(
"op_type"=>1,
"key"=>get_user_account($_POST['id']).'的真实姓名修改为:'.$_POST['real_name'],
"key"=>get_user_account($_POST['id']).'的真实姓名修改为:'.$realName,
"url"=>U("Member/edit",array("id"=>$_POST['id'])),
"menu"=>"用户-玩家组-玩家列表-编辑-真实姓名修改",
));
@ -810,9 +817,6 @@ class MemberController extends ThinkController
} else {
$this->ajaxReturn(array("status" => 0, "msg" => "真实姓名修改失败"));
}
} else {
$this->ajaxReturn(array("status" => 0, "msg" => "真实姓名输入错误"));
}
}

@ -380,11 +380,16 @@
value: ''
}, function (real_name) {
var jsid = $('#selfid').val();
if (real_name.indexOf('·') > 0) {
} else {
var realName = /^[\u4E00-\u9FA5]{2,4}$/;
if(!realName.test(real_name)){
layer.msg("真实姓名填写有误");
return false;
}
}
$.ajax({
url: '{:U("changeprelname")}',
type: 'post',

Loading…
Cancel
Save