Files
lgp-admin-plus-api/config/nl.php
LQ bcf54c2727 初始化
缺陷:主题配色需要优化整体的同风格
2026-08-14 23:21:21 +08:00

217 lines
7.4 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
return [
/*
* 过期时间配置
*/
'time_out' => [
// 订单
'product_order' => [
'over_time' => 24*3600,//秒,自动取消时间
// 'over_time' => 3,//秒,自动取消时间
'received_time' => 7*24*3600,//自动确认收货时间
'forbidden_refund_time' => 30*24*3600, //不允许退款时间
'settlement_time' => 0//7*24*3600//订单发货 分账自动结算时间
],
// 处方
'prescription' => [
'over_time' => 24*3600 //处方审核自动失效时间
// 'over_time' => 0 //处方审核自动失效时间
],
],
/*
* JWT 配置HS256 密钥至少 32 字节,否则 firebase/php-jwt 报 Provided key is too short
*/
'jwt' => [
'secret' => env('JWT_SECRET', 'nl_admin_jwt_secret_key_change_me_32b'),
// token 过期后仍允许续签的宽限期,超过就必须重新登录
'refresh_ttl' => (int) env('JWT_REFRESH_TTL', 7 * 24 * 3600),
],
/*
* 小程序端
*/
'wx' => [
// 小程序不像浏览器那样会主动续签token 有效期给长一点,作废靠后台停用账号
'token_ttl' => (int) env('WX_TOKEN_TTL', 30 * 24 * 3600),
// 单品牌部署兜底:请求头 X-App-Code 为空时用这个 code 查 nl_wx_app
// 双品牌共用进程时仍以表 + 请求头分流为主,这里只是「没带头的默认值」
'default_app_code' => env('WX_DEFAULT_APP_CODE', ''),
// 库表无数据时回落用的 AppID仅公开标识AppSecret 仍必须从库里加密读)
'env_app_id' => env('WX_APP_ID', ''),
// 与 env_app_id 配套的品牌展示名(仅用于日志/默认记录),无业务影响
'env_app_name' => env('WX_APP_NAME', ''),
],
/*
* 自助注册:后台管理端默认关闭,开着等于谁都能给自己开管理员账号
*/
'register' => [
'enabled' => (bool) env('REGISTER_ENABLED', false),
'default_role_id' => (int) env('REGISTER_DEFAULT_ROLE_ID', 2),
],
/*
* 库内敏感字段 AES 密钥(密文前缀 nl_ase_256_读取兼容历史 ***
* 对应 .envENCRYPT_KEY
*/
'encrypt_key' => env('ENCRYPT_KEY', ''),
/*
* 传输层 ase_encode / ase_decode 随机盐长度(与历史 helpers 兼容)
*/
'ase_len' => (int) env('ASE_LEN', 30),
/*
* redis配置
*/
'redis' => [
'jwt' => 'nl_login_',
'jwt_ttl' => 360000,
// 'jwt_ttl' => 360,
'email' => 'nl_email_',
'phone' => 'nl_phone_',
'login_out_key' => 'nl_login_out_',
'menu_key' => 'nl_menu_',
// 角色权限码缓存前缀key = 前缀 + roleId
'permission_key' => 'nl_perm_',
// 公众号 stable access_token 缓存前缀key = 前缀 + appidTTL 随微信 expires_in
'wechat_token' => 'nl_wechat_at_',
],
/*
* api白名单
*/
'api' => [
/*
* 免鉴权路径(不含 /api/ 前缀,中间件规范化后比较)
* 这里是「连 token 都不要求」的接口,注册在 routes/api.php 的免登录组里
*/
'white_list' => [
'login',
'register',
'logout',
'refresh',
'sql/test-connection',
'sql/start-installation',
],
/*
* 接口级权限
* strict = true 未登记进 nl_api_endpoint 的接口一律拒绝(安全优先,上线前打开)
* strict = false 未登记的接口放行,只拦已登记但未授权的(迁移期默认)
*/
'permission' => [
'strict' => (bool) env('API_PERMISSION_STRICT', false),
// 登录后人人可调、不参与角色授权的接口
'always_allow' => [
'admin/codes',
'admin/menu',
'admin/my-info',
'admin/update-profile',
'admin/change-password',
'admin/login-log',
'admin/op-log',
'upload/image',
'upload/video',
'upload/file',
],
],
],
/*
* 阿里云oss配置
*/
'oss' => [
'redis_key' => 'nl_oss_url_',
'ali' => [
'accessKeyId' => env('OSS_ACCESS_KEY_ID'),
'accessKeySecret' => env('OSS_ACCESS_KEY_SECRET'),
'endpoint' => env('OSS_ENDPOINT'),
'bucket' => env('OSS_BUCKET'),
'domain' => env('OSS_DOMAIN'),
],
'qiniu' => [
'access_key' => env('QINIU_ACCESS_KEY', ''),
'secret_key' => env('QINIU_SECRET_KEY', ''),
'bucket' => env('QINIU_BUCKET', ''),
'domain' => env('QINIU_DOMAIN', ''),
]
],
/*
* 短信配置
*/
'sms' => [
'ali' => [
'status' => '1',
'access_key_id' => env('ALIYUN_SMS_ACCESS_KEY_ID'),
'access_key_secret' => env('ALIYUN_SMS_ACCESS_KEY_SECRET'),
'sign_name' => env('ALIYUN_SMS_SIGN_NAME'),
'captcha' => [
"template_id" => "SMS_275060336", // 模板id
"template_variable" => "code", //模板变量
],
"doctor" => [
"register" => [ //挂号订单提醒
"template_id" => "SMS_462205458",
"template_variable" => ""
],
"prescription_pass" => [
"template_id" => "SMS_462260412",
"template_variable" => "order"
],
"prescription_refuse" => [
"template_id" => "SMS_462230433",
"template_variable" => [
"order",
"cause"
]
]
],
"pharmacist" => [
"wait_approval" => [
"template_id" => "SMS_462255406",
"template_variable" => ""
]
]
]
],
/*
* 旧接口配置
*/
'base_url' => [
'old_api' => env('BASE_OLD_API_URL', ''),
'old_shop_api' => env('BASE_OLD_SHOP_API_URL', ''),
// 微信接口
'we_chat_api' => env('BASE_WE_CHAT_API_URL', ''),
],
/*
* 日志配置
*/
'log' => [
// 不添加返回记录的api接口路径不含 /api/ 前缀,与中间件规范化后一致)
'no_insert' => [
'login',
'register',
'admin/my-info',
'admin/codes',
'admin/menu',
'admin/login-log',
'admin/op-log',
'api-endpoint/list',
'oss-config/runtime-options',
'oss-config/driver-options',
'oss-config/list',
'ai-config/runtime-options',
'ai-config/key-list',
'ai-config/platform-option',
'ai-config/generation-list',
'wechat-account/list',
'wechat-account/option',
'wechat-article/list',
'wechat-article/version-list',
]
],
'app' => [
'we_chat' => [
'app_id' => '',
'app_secret' => '',
'merchant_id' => '',
'merchant_key' => '',
'apiclient_cert' => '',
'apiclient_key' => ''
]
],
];