From b8f05ec3800d6a703d555241f740d042796f346e Mon Sep 17 00:00:00 2001 From: liaojinling <360197197@qq.com> Date: Wed, 2 Oct 2019 22:44:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E7=AB=AF=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=E3=80=81?= =?UTF-8?q?cookie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mobile/Controller/UserController.class.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Application/Mobile/Controller/UserController.class.php b/Application/Mobile/Controller/UserController.class.php index afad2c608..90d7cee17 100644 --- a/Application/Mobile/Controller/UserController.class.php +++ b/Application/Mobile/Controller/UserController.class.php @@ -5,6 +5,7 @@ use User\Api\SuserApi; use Org\UcenterSDK\Ucservice; use User\Api\MemberApi; use Admin\Model\PointTypeModel; +use Think\Log; class UserController extends BaseController { private $suser; @@ -31,7 +32,7 @@ class UserController extends BaseController { $member = new MemberApi(); /*是否开启Ucenter*/ - if( C('UC_OPEN')==1 ){ + if( C('UC_OPEN')==1 ) { $username = $account; //Ucenter登录 @@ -218,6 +219,12 @@ class UserController extends BaseController { } echo json_encode($data);die(); } else { + $pid = I('get.pid', 0); + $gid = I('get.gid', 0); + if ($pid > 0 || $gid > 0) { + cookie('pgInfo', json_encode(['pid' => $pid, 'gid' => $gid]), 3600 * 24); + } + if($_REQUEST['url']){ $this->assign('url',base64_decode(base64_decode($_REQUEST['url']))); }else{ @@ -339,7 +346,8 @@ class UserController extends BaseController { echo json_encode(['status' => 0,'msg' => '密码格式不正确']); die; } - + $pgInfo = strval(cookie('pgInfo')); + Log::write('register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($_POST) . ' --- ' . $pgInfo, 'INFO'); if (isset($_POST['promote_id']) && !empty($_POST['promote_id'])) { $pid = $this->suser->register($phone,$password,$phone,$register_way,$register_type,$_POST['promote_id'],$_POST['promote_account'],$sex,$nickname,$head_img); } else { @@ -368,6 +376,12 @@ class UserController extends BaseController { } echo json_encode($data); } else{ + $pid = I('get.pid', 0); + $gid = I('get.gid', 0); + if ($pid > 0 || $gid > 0) { + cookie('pgInfo', json_encode(['pid' => $pid, 'gid' => $gid]), 3600 * 24); + } + if ($_REQUEST['url']) { $url= base64_decode($_REQUEST['url']); } else {