手机端注册登录添加日志、cookie

master
liaojinling 5 years ago
parent 22783c3168
commit b8f05ec380

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

Loading…
Cancel
Save