From c314175eccd461285ce9c12425b5a965214cd748 Mon Sep 17 00:00:00 2001 From: hujiabin Date: Wed, 19 Oct 2022 14:01:20 +0800 Subject: [PATCH] 1 --- webapp/controller/UserController.class.php | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 58e17685..fbe62e81 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -41,10 +41,23 @@ class UserController extends BaseAuthedController { $avatarUrl = '18003'; $userInfo = $this->_safeGetOrmUserInfo(); - + $is_new_user = 0; if (SERVER_ENV == _ONLINE) { + if (!$userInfo) { + $is_new_user = 1; + $this->createNewUser($userName, $avatarUrl); + $this->addChip(); //测试数据,上线要删除 + $this->addFragmentBox(); //测试数据,上线要删除 + $userInfo = $this->_getOrmUserInfo(); + $this->_setV(TN_RANK_STATUS, 0, 1); + } + if (!$this->loginCheck($userInfo)) { + $userInfo = $this->_getOrmUserInfo(); + } + }else{ //测试服 if (!$userInfo) { + $is_new_user = 1; $this->createNewUserV2($userName); $this->addChip(); //测试需要,上线要删除 $this->addFragmentBox(); //测试需要,上线要删除 @@ -58,21 +71,11 @@ class UserController extends BaseAuthedController { $this->_updateUserInfo(array( 'last_login_time'=>myself()->_getNowTime(), )); - }else{ - if (!$userInfo) { - $this->createNewUser($userName, $avatarUrl); - $this->addChip(); //测试需要,上线要删除 - $this->addFragmentBox(); //测试需要,上线要删除 - $userInfo = $this->_getOrmUserInfo(); - $this->_setV(TN_RANK_STATUS, 0, 1); - } - if (!$this->loginCheck($userInfo)) { - $userInfo = $this->_getOrmUserInfo(); - } } $this->updateLastSeason($userInfo); $this->_rspData(array( - 'info' => User::show($userInfo) + 'info' => User::show($userInfo), + 'is_newUser' => $is_new_user, //1 是,0 不是 )); $this->_incDailyV(TN_DAILY_LOGINS, 0, 1); }