1.新增游戏管理接口和菜单
2.创建对接第三方文档
This commit is contained in:
42
server/scripts/gen_auth_token_signature.php
Normal file
42
server/scripts/gen_auth_token_signature.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* 生成 /api/v1/authToken(或 /api/v1/authtoken)所需 signature
|
||||
*
|
||||
* 用法:
|
||||
* php scripts/gen_auth_token_signature.php --agent_id=1001 --secret=your_secret
|
||||
* php scripts/gen_auth_token_signature.php --agent_id=1001 --secret=your_secret --time=1713772800
|
||||
*/
|
||||
|
||||
$options = getopt('', ['agent_id:', 'secret:', 'time::']);
|
||||
|
||||
$agentId = $options['agent_id'] ?? '';
|
||||
$secret = $options['secret'] ?? '';
|
||||
$time = $options['time'] ?? (string) time();
|
||||
|
||||
if ($agentId === '' || $secret === '' || $time === '') {
|
||||
echo "缺少参数。\n";
|
||||
echo "用法: php scripts/gen_auth_token_signature.php --agent_id=1001 --secret=your_secret [--time=unix_timestamp]\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (ctype_digit($time) === false) {
|
||||
echo "time 必须是 unix 时间戳(纯数字字符串)。\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$signature = md5($agentId . $secret . $time);
|
||||
$query = http_build_query([
|
||||
'agent_id' => $agentId,
|
||||
'secret' => $secret,
|
||||
'time' => $time,
|
||||
'signature' => $signature,
|
||||
]);
|
||||
|
||||
echo "agent_id: {$agentId}\n";
|
||||
echo "secret: {$secret}\n";
|
||||
echo "time: {$time}\n";
|
||||
echo "signature: {$signature}\n";
|
||||
echo "query: {$query}\n";
|
||||
|
||||
@@ -43,7 +43,6 @@ $fallbackCn = [
|
||||
'添加失败' => 'add failed',
|
||||
'修改失败' => 'update failed',
|
||||
'删除失败' => 'delete failed',
|
||||
'请选择要删除的数据' => 'please select data to delete',
|
||||
'参数错误,请检查' => 'invalid parameters, please check',
|
||||
'参数错误,请检查参数' => 'invalid parameters, please check',
|
||||
'操作失败' => 'operation failed',
|
||||
|
||||
Reference in New Issue
Block a user