diff --git a/app/index/controller/User.php b/app/index/controller/User.php index d4a1c76..82e1756 100644 --- a/app/index/controller/User.php +++ b/app/index/controller/User.php @@ -73,7 +73,7 @@ class User extends BaseController public function set() { if(Request::isAjax()){ - $data = Request::param(); + $data = Request::only(['user_id','email','nickname','sex','city','sign']); $validate = new \app\common\validate\User(); $result = $validate->scene('Set')->check($data); if(!$result){ @@ -82,7 +82,7 @@ class User extends BaseController $user = new \app\common\model\User(); $result = $user->setNew($data); if($result==1){ - return ['code'=>1,'msg'=>'资料更新成功','url'=>'/index/user/set']; + return ['code'=>0,'msg'=>'资料更新成功','url'=>'/index/user/set']; } else { $this->error($result); } diff --git a/view/index/user/set.html b/view/index/user/set.html index 9e9f4c1..d370d9a 100644 --- a/view/index/user/set.html +++ b/view/index/user/set.html @@ -120,11 +120,11 @@ $(function(){ $('#ziliao').click(function(){ $.ajax({ type:'post', - url:"{:url('index/user/set')}", + url:"{:url('user/set')}", data:$('#zl').serialize(), dataType:"json", success:function(data){ - if(data.code == 1){ + if(data.code == 0){ layer.msg(data.msg,{ icon:6, tiye:2000