-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
2,145 additions
and
1,273 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
app/Core/Admin/Http/Controllers/Api/HelperAdminController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Flute\Core\Admin\Http\Controllers\Api; | ||
|
||
use Flute\Core\Admin\Http\Middlewares\HasPermissionMiddleware; | ||
use Flute\Core\Support\AbstractController; | ||
use Flute\Core\Support\FluteRequest; | ||
|
||
class HelperAdminController extends AbstractController | ||
{ | ||
public function __construct() | ||
{ | ||
HasPermissionMiddleware::permission('admin.system'); | ||
} | ||
|
||
public function getIP(FluteRequest $fluteRequest) | ||
{ | ||
return json([ | ||
'ip' => $fluteRequest->getClientIp(), | ||
]); | ||
} | ||
|
||
public function checkSteam(FluteRequest $fluteRequest) | ||
{ | ||
$token = $fluteRequest->input('apiKey'); | ||
|
||
if (!$token) | ||
return $this->error(__("admin.app.token_incorrect")); | ||
|
||
config()->set('app.steam_api', $token); | ||
|
||
try { | ||
|
||
$player = steam()->getUser(76561198295345385, true); | ||
|
||
if (empty($player)) { | ||
return $this->error(__("admin.app.token_incorrect")); | ||
} | ||
} catch (\Exception $e) { | ||
return $this->error(__("admin.app.token_incorrect")); | ||
} | ||
|
||
return $this->success(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.