1.优化玩家管理页面/dice/player/index获取游戏链接逻辑
This commit is contained in:
@@ -355,6 +355,7 @@ class DicePlayerController extends BaseController
|
||||
return $this->fail('generate token failed');
|
||||
}
|
||||
UserCache::setSessionByUsername($username, $token);
|
||||
UserCache::setCurrentUserToken((int) $player->id, $token);
|
||||
$userArr = $player->hidden(['password', 'lottery_config_id', 't1_weight', 't2_weight', 't3_weight', 't4_weight', 't5_weight'])->toArray();
|
||||
UserCache::setUser((int) $player->id, $userArr);
|
||||
UserCache::setPlayerByUsername($username, $userArr);
|
||||
@@ -363,6 +364,9 @@ class DicePlayerController extends BaseController
|
||||
if ($gameUrlBase === '') {
|
||||
return $this->fail('GAME_URL is not configured');
|
||||
}
|
||||
if (!str_starts_with($gameUrlBase, 'http://') && !str_starts_with($gameUrlBase, 'https://')) {
|
||||
$gameUrlBase = 'https://' . $gameUrlBase;
|
||||
}
|
||||
$tokenInUrl = str_replace('%3D', '=', urlencode($token));
|
||||
$url = $gameUrlBase . '/?token=' . $tokenInUrl . '&lang=' . $lang;
|
||||
return $this->success(['url' => $url]);
|
||||
|
||||
Reference in New Issue
Block a user