Files
hdk/publish/common.php
2022-06-07 18:38:13 +08:00

52 lines
1.4 KiB
PHP

<?php
/**
* common.php@hyperf-development-kit
*
* @author 李东云<dongyun.li@luxcreo.cn>
* Powered by PhpStorm
* Created on 2022/4/27
*/
declare(strict_types=1);
return [
// 响应
'response' => [
'restful' => false, // 若禁用,则状态码永远只为 200
'code_name' => 'code', // 错误码名称
'message_name' => 'message', // 错误信息名称
'data_name' => 'data', // 响应数据字段名称
],
// 鉴权相关
'token' => [
// jwt 必需,否则无效
'jwt' => [
// 过期时间
'expire_time' => 30 * 24 * 60 * 60,
'private_key' => '', // 用于加密 jwt
'public_key' => '', // 用于解密 jwt
],
// session 必需,否则无效
'session' => [
// 'expire_time' => null, // 始终为 session 的过期时间
'forbidden_key' => 'user:last_invalidate_time', // redis 中储存时的 key 名(此时间之前登录的用户都会被 T 掉)
],
'app' => [
'expire_time' => 30 * 24 * 60 * 60,
'prefix_key' => 'token:'
]
],
// redis 补充配置
'redis' => [
'prefix' => sprintf(
"%s:%s:",
env('APP_NAME'),
env('APP_ENV', 'product')
), // 强烈建议按此格式划分
],
];