diff --git a/app/Http/Controllers/Weixin/UserController.php b/app/Http/Controllers/Weixin/UserController.php index c5341c9..46072b3 100644 --- a/app/Http/Controllers/Weixin/UserController.php +++ b/app/Http/Controllers/Weixin/UserController.php @@ -321,9 +321,9 @@ class UserController extends CommonController ); $url = env('APP_API_URL')."/wx_oauth_register"; $res = curl_request($url,$postdata,'POST'); - dd($postdata); - if($res['code'] != ReturnCode::SUCCESS_CODE){$this->error_jump('系统错误');} + if($res['code'] != ReturnCode::SUCCESS_CODE){$this->error_jump('系统错误');} + dd($res); $_SESSION['weixin_user_info'] = $res['data']; header('Location: '.route('weixin_user'));exit; diff --git a/app/Http/Model/User.php b/app/Http/Model/User.php index 0fa7081..451c316 100644 --- a/app/Http/Model/User.php +++ b/app/Http/Model/User.php @@ -179,11 +179,11 @@ class User extends BaseModel if(isset($user_name)){$data['user_name'] = $user_name;} if(isset($mobile)){$data['mobile'] = $mobile;} if(isset($password)){$data['password'] = $password;} //md5加密 - if(isset($parent_id)){$data['parent_id'] = $parent_id;} - if(isset($openid)){$data['openid'] = $openid} - if(isset($sex)){$data['sex'] = $sex} - if(isset($head_img)){$data['head_img'] = $head_img} - if(isset($nickname)){$data['nickname'] = $nickname} + if(isset($parent_id) && !empty($parent_id)){$data['parent_id'] = $parent_id;} + if(isset($openid)){$data['openid'] = $openid;} + if(isset($sex)){$data['sex'] = $sex;} + if(isset($head_img)){$data['head_img'] = $head_img;} + if(isset($nickname)){$data['nickname'] = $nickname;} if (isset($data) && $id = self::add($data)) { diff --git a/resources/views/weixin/user/login.blade.php b/resources/views/weixin/user/login.blade.php index b49aecd..fef72d9 100644 --- a/resources/views/weixin/user/login.blade.php +++ b/resources/views/weixin/user/login.blade.php @@ -39,7 +39,7 @@ 登录