优化临时插入用户接口/api/user/Login和抽奖接口/api/game/playStart
This commit is contained in:
@@ -26,9 +26,13 @@ class UserController extends BaseController
|
||||
*/
|
||||
public function Login(Request $request): Response
|
||||
{
|
||||
$username = trim((string) ($request->post('username', '')));
|
||||
$password = trim((string) ($request->post('password', '')));
|
||||
$lang = trim((string) ($request->post('lang', 'chs')));
|
||||
$usernameRaw = $request->post('username', '');
|
||||
$passwordRaw = $request->post('password', '');
|
||||
$langRaw = $request->post('lang', 'zh');
|
||||
|
||||
$username = is_string($usernameRaw) ? trim($usernameRaw) : '';
|
||||
$password = is_string($passwordRaw) ? trim($passwordRaw) : '';
|
||||
$lang = is_string($langRaw) ? trim($langRaw) : 'zh';
|
||||
$coin = $request->post('coin');
|
||||
$coin = $coin !== null && $coin !== '' ? (float) $coin : 0.0;
|
||||
$time = $request->post('time');
|
||||
|
||||
@@ -58,7 +58,7 @@ class GameController extends BaseController
|
||||
|
||||
try {
|
||||
$logic = new UserLogic();
|
||||
$result = $logic->loginByUsername($username, $password, $lang === 'en' ? 'en' : 'chs', 0.0, $time, $adminId, $adminIdsInTopDept);
|
||||
$result = $logic->loginByUsername($username, $password, $lang, 0.0, $time, $adminId, $adminIdsInTopDept);
|
||||
} catch (\plugin\saiadmin\exception\ApiException $e) {
|
||||
return $this->fail($e->getMessage(), ReturnCode::PARAMS_ERROR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user