This commit is contained in:
zhao 2020-02-19 22:05:48 +08:00
parent 8272f4398a
commit 4c3d227b4c
2 changed files with 4 additions and 4 deletions

View File

@ -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);
}

View File

@ -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