初始化-安装依赖
This commit is contained in:
83
server/config/plugin/tinywan/jwt/app.php
Normal file
83
server/config/plugin/tinywan/jwt/app.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
'jwt' => [
|
||||
/** 算法类型 HS256、HS384、HS512、RS256、RS384、RS512、ES256、ES384、ES512、PS256、PS384、PS512 */
|
||||
'algorithms' => 'HS256',
|
||||
|
||||
/** access令牌秘钥(安装时自动生成64位随机值) */
|
||||
'access_secret_key' => 'd7d2058d654799bfdf290fb91757681793e6549effc2e41c6e7dafe3ecfcbc8a',
|
||||
|
||||
/** access令牌过期时间,单位:秒。默认 2 小时 */
|
||||
'access_exp' => 7200,
|
||||
|
||||
/** refresh令牌秘钥(安装时自动生成64位随机值) */
|
||||
'refresh_secret_key' => 'f02fc466bd03a133fa8f30bd58f302f4ea706c41eff521b6319a8af099b11e64',
|
||||
|
||||
/** refresh令牌过期时间,单位:秒。默认 7 天 */
|
||||
'refresh_exp' => 604800,
|
||||
|
||||
/** refresh 令牌是否禁用,默认不禁用 false */
|
||||
'refresh_disable' => false,
|
||||
|
||||
/** 令牌签发者 */
|
||||
'iss' => 'webman.tinywan.cn',
|
||||
|
||||
/** 某个时间点后才能访问,单位秒。(如:30 表示当前时间30秒后才能使用) */
|
||||
'nbf' => 0,
|
||||
|
||||
/** 时钟偏差冗余时间,单位秒。建议这个余地应该不大于几分钟 */
|
||||
'leeway' => 60,
|
||||
|
||||
/** 是否允许单设备登录,默认不允许 false */
|
||||
'is_single_device' => false,
|
||||
|
||||
/** 缓存令牌时间,单位:秒。默认 7 天 */
|
||||
'cache_token_ttl' => 604800,
|
||||
|
||||
/** 缓存令牌前缀,默认 JWT:TOKEN: */
|
||||
'cache_token_pre' => 'JWT:TOKEN:',
|
||||
|
||||
/** 缓存刷新令牌前缀,默认 JWT:REFRESH_TOKEN: */
|
||||
'cache_refresh_token_pre' => 'JWT:REFRESH_TOKEN:',
|
||||
|
||||
/** 用户信息模型 */
|
||||
'user_model' => function ($uid) {
|
||||
return [];
|
||||
},
|
||||
|
||||
/** 是否支持 get 请求获取令牌 */
|
||||
'is_support_get_token' => false,
|
||||
/** GET 请求获取令牌请求key */
|
||||
'is_support_get_token_key' => 'authorization',
|
||||
|
||||
/** access令牌私钥 */
|
||||
'access_private_key' => <<<EOD
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
...
|
||||
-----END RSA PRIVATE KEY-----
|
||||
EOD,
|
||||
|
||||
/** access令牌公钥 */
|
||||
'access_public_key' => <<<EOD
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
...
|
||||
-----END PUBLIC KEY-----
|
||||
EOD,
|
||||
|
||||
/** refresh令牌私钥 */
|
||||
'refresh_private_key' => <<<EOD
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
...
|
||||
-----END RSA PRIVATE KEY-----
|
||||
EOD,
|
||||
|
||||
/** refresh令牌公钥 */
|
||||
'refresh_public_key' => <<<EOD
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
...
|
||||
-----END PUBLIC KEY-----
|
||||
EOD,
|
||||
],
|
||||
];
|
||||
76
server/config/plugin/tinywan/storage/app.php
Normal file
76
server/config/plugin/tinywan/storage/app.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* @desc app.php 描述信息
|
||||
*
|
||||
* @author Tinywan(ShaoBo Wan)
|
||||
* @date 2022/3/10 19:46
|
||||
*/
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
'storage' => [
|
||||
'default' => 'local', // local:本地 oss:阿里云 cos:腾讯云 qos:七牛云
|
||||
'single_limit' => 1024 * 1024 * 200, // 单个文件的大小限制,默认200M 1024 * 1024 * 200
|
||||
'total_limit' => 1024 * 1024 * 200, // 所有文件的大小限制,默认200M 1024 * 1024 * 200
|
||||
'nums' => 10, // 文件数量限制,默认10
|
||||
'include' => [], // 被允许的文件类型列表
|
||||
'exclude' => [], // 不被允许的文件类型列表
|
||||
// 本地对象存储
|
||||
'local' => [
|
||||
'adapter' => \Tinywan\Storage\Adapter\LocalAdapter::class,
|
||||
'root' => runtime_path().'/storage',
|
||||
'dirname' => function () {
|
||||
return date('Ymd');
|
||||
},
|
||||
'domain' => 'http://127.0.0.1:8787',
|
||||
'uri' => '/runtime', // 如果 domain + uri 不在 public 目录下,请做好软链接,否则生成的url无法访问
|
||||
'algo' => 'sha1',
|
||||
],
|
||||
// 阿里云对象存储
|
||||
'oss' => [
|
||||
'adapter' => \Tinywan\Storage\Adapter\OssAdapter::class,
|
||||
'accessKeyId' => 'xxxxxxxxxxxx',
|
||||
'accessKeySecret' => 'xxxxxxxxxxxx',
|
||||
'bucket' => 'resty-webman',
|
||||
'dirname' => function () {
|
||||
return 'storage';
|
||||
},
|
||||
'domain' => 'http://webman.oss.tinywan.com',
|
||||
'endpoint' => 'oss-cn-hangzhou.aliyuncs.com',
|
||||
'algo' => 'sha1',
|
||||
],
|
||||
// 腾讯云对象存储
|
||||
'cos' => [
|
||||
'adapter' => \Tinywan\Storage\Adapter\CosAdapter::class,
|
||||
'secretId' => 'xxxxxxxxxxxxx',
|
||||
'secretKey' => 'xxxxxxxxxxxx',
|
||||
'bucket' => 'resty-webman-xxxxxxxxx',
|
||||
'dirname' => 'storage',
|
||||
'domain' => 'http://webman.oss.tinywan.com',
|
||||
'region' => 'ap-shanghai',
|
||||
],
|
||||
// 七牛云对象存储
|
||||
'qiniu' => [
|
||||
'adapter' => \Tinywan\Storage\Adapter\QiniuAdapter::class,
|
||||
'accessKey' => 'xxxxxxxxxxxxx',
|
||||
'secretKey' => 'xxxxxxxxxxxxx',
|
||||
'bucket' => 'resty-webman',
|
||||
'dirname' => 'storage',
|
||||
'domain' => 'http://webman.oss.tinywan.com',
|
||||
],
|
||||
// aws
|
||||
's3' => [
|
||||
'adapter' => \Tinywan\Storage\Adapter\S3Adapter::class,
|
||||
'key' => 'xxxxxxxxxxxxx',
|
||||
'secret' => 'xxxxxxxxxxxxx',
|
||||
'bucket' => 'resty-webman',
|
||||
'dirname' => 'storage',
|
||||
'domain' => 'http://webman.oss.tinywan.com',
|
||||
'region' => 'S3_REGION',
|
||||
'version' => 'latest',
|
||||
'use_path_style_endpoint' => true,
|
||||
'endpoint' => 'S3_ENDPOINT',
|
||||
'acl' => 'public-read',
|
||||
],
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user