Browse Source

微信注册bug

master
ZLW-PC\Administrator 7 years ago
parent
commit
78d28948e0
  1. 4
      app/Http/Controllers/Weixin/UserController.php
  2. 10
      app/Http/Model/User.php
  3. 2
      resources/views/weixin/user/login.blade.php

4
app/Http/Controllers/Weixin/UserController.php

@ -321,9 +321,9 @@ class UserController extends CommonController
); );
$url = env('APP_API_URL')."/wx_oauth_register"; $url = env('APP_API_URL')."/wx_oauth_register";
$res = curl_request($url,$postdata,'POST'); $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']; $_SESSION['weixin_user_info'] = $res['data'];
header('Location: '.route('weixin_user'));exit; header('Location: '.route('weixin_user'));exit;

10
app/Http/Model/User.php

@ -179,11 +179,11 @@ class User extends BaseModel
if(isset($user_name)){$data['user_name'] = $user_name;} if(isset($user_name)){$data['user_name'] = $user_name;}
if(isset($mobile)){$data['mobile'] = $mobile;} if(isset($mobile)){$data['mobile'] = $mobile;}
if(isset($password)){$data['password'] = $password;} //md5加密 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)) if (isset($data) && $id = self::add($data))
{ {

2
resources/views/weixin/user/login.blade.php

@ -39,7 +39,7 @@
<a style="margin:10px;background-color:#1aad19;text-align:center;color:white;border:1px solid #179e16;" class="bottoma" href="javascript:submit();">登录</a> <a style="margin:10px;background-color:#1aad19;text-align:center;color:white;border:1px solid #179e16;" class="bottoma" href="javascript:submit();">登录</a>
</div> </div>
<div class="box reg"> <div class="box reg">
<a style="float:left;" href="<?php echo route('weixin_register'); ?>">快速注册</a> <a style="float:left;" href="<?php echo route('weixin_register'); ?>">微信</a> <a style="float:right;" href="">忘记密码?</a>
<a style="float:left;" href="<?php echo route('weixin_wxoauth'); ?>">微信登录</a> <span style="float:right;"><a href="<?php echo route('weixin_register'); ?>">快速注册</a> | <a href="">忘记密码?</a></span>
</div><br><br> </div><br><br>
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/md5.min.js"></script> <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/md5.min.js"></script>
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/layer/mobile/layer.js"></script> <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/layer/mobile/layer.js"></script>

Loading…
Cancel
Save