This commit is contained in:
hujiabin 2022-10-19 14:01:20 +08:00
parent bc6e664d09
commit c314175ecc

View File

@ -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);
}