1.优化/api/v1/getGameUrl接口,无需再验证password
This commit is contained in:
@@ -92,15 +92,11 @@ class GameController extends BaseController
|
||||
public function getGameUrl(Request $request): Response
|
||||
{
|
||||
$username = trim((string) ($request->post('username', '')));
|
||||
$password = trim((string) ($request->post('password', '123456')));
|
||||
$time = trim((string) ($request->post('time', '')));
|
||||
|
||||
if ($username === '') {
|
||||
return $this->fail('username is required', ReturnCode::PARAMS_ERROR);
|
||||
}
|
||||
if ($password === '') {
|
||||
$password = '123456';
|
||||
}
|
||||
if ($time === '') {
|
||||
$time = (string) time();
|
||||
}
|
||||
@@ -114,7 +110,8 @@ class GameController extends BaseController
|
||||
|
||||
try {
|
||||
$logic = new UserLogic();
|
||||
$result = $logic->loginByUsername($username, $password, $lang, 0.0, $time, $adminId, $adminIdsInTopDept, $deptId);
|
||||
// 平台 v1 已通过 api-key + auth-token 双重校验,此处不再做 password 校验
|
||||
$result = $logic->loginByUsername($username, '', $lang, 0.0, $time, $adminId, $adminIdsInTopDept, $deptId, true);
|
||||
} catch (\plugin\saiadmin\exception\ApiException $e) {
|
||||
return $this->fail($e->getMessage(), ReturnCode::PARAMS_ERROR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user