init(core): 初始化代码

This commit is contained in:
李东云
2022-12-19 17:28:55 +08:00
parent a13779ab3f
commit f564d01766
52 changed files with 9043 additions and 943 deletions

82
publish/common.php Normal file
View File

@@ -0,0 +1,82 @@
<?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')
), // 强烈建议按此格式划分
],
// account http请求配置
'http_request' => [
'account' => [
'api_base_uri' => env('API_BASE_URI', ''),
'rpc_base_uri' => env('RPC_BASE_URI', ''),
],
],
// 第三方服务
'third_party' => [
'email' => [
'dsn' => 'smtp://account@luxcreo.ai:Qfsd8866@smtp.qiye.aliyun.com:465',
'mailer_sender' => 'account@luxcreo.ai', // 发件邮箱
'mailer_sender_name' => 'LuxCreo', // 发件人名称
],
'sms' => [
'aliyun' => [
'access_key_id' => env('ACCESS_KEY_ID', ''),
'access_key_secret' => env('ACCESS_KEY_SECRET', ''),
'sign' => '', // 短信签名名称
'template_code' => '', // 短信模板CODE
],
],
'storage' => [
'oss' => [
'access_key_id' => env('ACCESS_KEY_ID', ''),
'access_key_secret' => env('ACCESS_KEY_SECRET', ''),
],
],
],
];