chore: 重写初始提交(清空历史,整理后全量提交)

This commit is contained in:
ywxapp
2026-08-16 16:54:14 +08:00
commit 6c1a106bc1
1808 changed files with 238144 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
'multi_app' => true, // 启用多应用模式
'priority' => ['addon', 'app'], // 模块查找优先级
'auto_prefix' => true, // 自动添加插件名前缀
'route_cache' => true, // 路由缓存
'addon_path' => root_path() . 'addon' . DIRECTORY_SEPARATOR,
'temp_path' => runtime_path() . 'temp' . DIRECTORY_SEPARATOR,
'allowed_extensions' => ['zip', 'tpplugin'],
'max_size' => 10 * 1024 * 1024, // 10MB
'addon_file' => 'addon.php', // 插件描述文件
];
+57
View File
@@ -0,0 +1,57 @@
<?php
/*
* @Author: YwxApp <ywx@ywxapp.cn>
* @Date: 2026-08-06 22:05:38
* @LastEditors: YwxApp <ywx@ywxapp.cn>
* @LastEditTime: 2026-08-14 10:47:33
* @Description:
* @FilePath: \ywxapp_dev\config\app.php
* @CustomString: Copyright (c) 2026 YwxApp
*/
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// 应用地址
'app_host' => env('APP_HOST', ''),
// 应用的命名空间
'app_namespace' => '',
// 是否启用路由
//'with_route' => true,
// 开启应用快速访问
'app_express' => false,
// 默认应用:填真实应用目录名(app_map 仅对非空 URL 段做别名映射,
// 默认应用不会经过映射,因此必须填真实目录名)
// wxapp = 框架展示官网(门面);frontend = 原企业站(经 home 别名访问)
'default_app' => 'frontend',
// 默认时区
'default_timezone' => 'Asia/Shanghai',
// 应用映射(自动多应用模式有效)
'app_map' => [
'home' => 'frontend',
'admin' => 'backend',
'user' =>'member'
],
// 域名绑定(自动多应用模式有效)
'domain_bind' => [
//'dev'=>'haonav',
],
// 关闭应用的路由功能
//'with_route' => false,
// 禁止URL访问的应用列表(自动多应用模式有效)
'deny_app_list' => [],
// 异常页面的模板文件
'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl',
// 错误显示信息,非调试模式有效
'error_message' => '页面错误!请稍后再试~',
// 显示错误信息
'show_error_msg' => true,
];
+17
View File
@@ -0,0 +1,17 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
'auth_on' => 1, // 权限开关
'auth_type' => 1, // 认证方式,1为实时认证;2为登录认证。
'auth_group' => 'auth_group', // 用户组数据表名
'auth_group_access' => 'auth_group_access', // 用户-用户组关系表
'auth_rule' => 'auth_rule', // 权限规则表
'auth_user' => 'member', // 用户信息表
];
+50
View File
@@ -0,0 +1,50 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// 默认缓存驱动
'default' => 'file',
'fail_delete' => true,
// 缓存连接方式配置
'stores' => [
'file' => [
// 驱动方式
'type' => 'File',
// 缓存保存目录
'path' => '',
// 缓存前缀
'prefix' => '',
// 缓存有效期 0表示永久缓存
'expire' => 0,
// 缓存标签前缀
'tag_prefix' => 'tag:',
// 序列化机制 例如 ['serialize', 'unserialize']
'serialize' => [],
],
// redis缓存
'redis' => [
// 驱动方式
'type' => 'redis',
// 服务器地址(读取环境变量,便于生产切换)
'host' => env('REDIS_HOST', '127.0.0.1'),
'port' => env('REDIS_PORT', 6379),
'password' => env('REDIS_PASSWORD', ''),
'select' => env('REDIS_DB', 0),
// 缓存前缀
'prefix' => '',
// 缓存有效期 0表示永久缓存
'expire' => 0,
// 缓存标签前缀
'tag_prefix' => 'tag:',
// 序列化机制 例如 ['serialize', 'unserialize']
'serialize' => [],
],
],
];
+52
View File
@@ -0,0 +1,52 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
// config/captcha.php
return [
// 验证码字符集合(默认为数字+大小写字母)
'codeSet' => '23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ',
// 过期时间(秒)
'expire' => 180,
// 是否启用算术验证码(如 3 + 5 = ?)
'math' => true,
// 是否使用中文验证码
'useZh' => false,
'zhSet' => '们以我到他会作时要动国产的一是工就年阶义发成部民可出能方进在了不和有大这主中人上为来分生对于学下级地个用同行面说种过命度革而多子后自社加小机也经力线本电高量长党得实家定深法表着水理化争现所二起政三好十战无农使性前等反体合斗路图把结第里正开论之公事长门及平队形相全表间样与关各重今常安活公同光证',
// 背景图片(需提供路径,相对 public 目录)
'useImgBg' => false,
// 字体大小(px
'fontSize' => 20,
// 是否画混淆曲线
'useCurve' => true,
// 是否添加杂点
'useNoise' => true,
// 图片尺寸(设为 0 自动计算)
'imageH' => 0,
'imageW' => 0,
// 验证码长度
'length' => 4,
// 字体文件(放在 public/static/font/ 下,例如:ttf/arial.ttf
'fontttf' => '',
// 背景色 RGB
'bg' => [243, 251, 254],
// 验证成功后是否自动清除 session 中的验证码
'reset' => true,
];
+13
View File
@@ -0,0 +1,13 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// 指令定义
'commands' => [
],
];
+24
View File
@@ -0,0 +1,24 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// cookie 保存时间
'expire' => 0,
// cookie 保存路径
'path' => '/',
// cookie 有效域名
'domain' => '',
// cookie 启用安全传输
'secure' => false,
// httponly设置
'httponly' => false,
// 是否使用 setcookie
'setcookie' => true,
// samesite 设置,支持 'strict' 'lax'
'samesite' => '',
];
+19
View File
@@ -0,0 +1,19 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
'paths' => [],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_methods' => ['*'],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
];
+83
View File
@@ -0,0 +1,83 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// 默认使用的数据库连接配置
'default' => env('DB_DRIVER', 'mysql'),
// 自定义时间查询规则
'time_query_rule' => [],
// 自动写入时间戳字段
// true为自动识别类型 false关闭
// 字符串则明确指定时间字段类型 支持 int timestamp datetime date
'auto_timestamp' => true,
// 时间字段取出后的默认时间格式
'datetime_format' => 'Y-m-d H:i:s',
// 时间字段配置 配置格式:create_time,update_time
'datetime_field' => '',
// 数据库连接配置信息
'connections' => [
'mysql' => [
// 数据库类型
'type' => env('DB_TYPE', 'mysql'),
// 服务器地址
'hostname' => env('DB_HOST', '127.0.0.1'),
// 数据库名
'database' => env('DB_NAME', ''),
// 用户名
'username' => env('DB_USER', 'root'),
// 密码
'password' => env('DB_PASS', ''),
// 端口
'hostport' => env('DB_PORT', '3306'),
// 数据库连接参数 - 启用持久连接和连接池
'params' => [
\PDO::ATTR_PERSISTENT => env('DB_PERSISTENT', true), // 启用持久连接
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, // 异常模式
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC, // 默认关联数组
\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', // 字符集
],
// 数据库编码默认采用utf8
'charset' => env('DB_CHARSET', 'utf8'),
// 数据库表前缀
'prefix' => env('DB_PREFIX', 'wxapp_'),
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
'rw_separate' => false,
// 读写分离后 主服务器数量
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// 是否严格检查字段是否存在
'fields_strict' => true,
// 是否需要断线重连
'break_reconnect' => true,
// 监听SQL
'trigger_sql' => env('APP_DEBUG', true),
// 开启字段缓存 - 提升性能,减少字段信息查询
'fields_cache' => false,
// 开启数据库调试模式 - 关键配置
'debug' => env('APP_DEBUG', false),
// 数据库日志记录级别
'log_sql' => env('APP_DEBUG', false),
// 断线标识字符串
'break_match_str' => [],
// 开启查询缓存 - 提升查询性能
'query_cache' => true,
],
// 更多的数据库配置信息
],
];
+79
View File
@@ -0,0 +1,79 @@
<?php
/*
* @Author: YwxApp <ywx@ywxapp.cn>
* @Date: 2026-04-29 02:32:33
* @LastEditors: YwxApp <ywx@ywxapp.cn>
* @LastEditTime: 2026-07-27 23:19:05
* @Description:
* @FilePath: \ywxapp_dev\config\filesystem.php
* @CustomString: Copyright (c) 2026 YwxApp
*/
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
// config/filesystem.php
return [
// 默认存储方式
'default' => 'local', // 这里可以切换为 'aliyun', 'cos', 'qiniu' 等
// 存储驱动配置
'disks' => [
// 本地存储(默认)
'local' => [
'type' => 'local',
'class' => 'ywxapp\utils\storage\LocalStorage',
'root' => app()->getRootPath() . 'public/storage',
'url' => request()->domain() . '/storage',
'visibility' => 'public',
],
'runtime' => [
'type' => 'local',
'root' => app()->getRootPath().'runtime',
],
// 示例:阿里云 OSS
'aliyun' => [
'type' => 'filesystem', // 使用Flysystem驱动
'class' => \League\Flysystem\Aliyun\AliyunOssAdapter::class,
'config' => [
'accessKeyId' => 'your-access-key-id', // 你的AccessKeyId
'accessKeySecret' => 'your-access-key-secret', // 你的AccessKeySecret
'endpoint' => 'https://oss-your-region.aliyuncs.com', // 端点
'bucket' => 'your-bucket-name', // 存储空间
'prefix' => '', // 文件路径前缀(可选)
],
],
// 示例:腾讯云 COS
'cos' => [
'type' => 'filesystem', // 使用Flysystem驱动
'class' => \League\Flysystem\Cos\CosAdapter::class,
'config' => [
'region' => 'ap-guangzhou', // 区域
'credentials' => [
'secretId' => 'your-secret-id', // SecretId
'secretKey' => 'your-secret-key', // SecretKey
],
'bucket' => 'your-bucket-name', // 存储桶
'endpoint' => 'https://cos.your-region.myqcloud.com', // 备用endpoint(可选)
],
],
// 示例:七牛云 Qiniu
'qiniu' => [
'type' => 'filesystem', // 使用Flysystem驱动
'class' => \League\Flysystem\Qiniu\QiniuAdapter::class,
'config' => [
'accessKey' => 'your-access-key', // AccessKey
'secretKey' => 'your-secret-key', // SecretKey
'bucket' => 'your-bucket', // 存储空间
'domain' => 'your-domain.com', // 绑定域名
'zone' => 'zone0', // 区域
],
],
],
];
+20
View File
@@ -0,0 +1,20 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
// frontend 应用级视图配置:开启「动态布局模式」
// 所有 frontend 视图渲染时,自动将内容嵌入 common/layout 的 {__CONTENT__} 占位符,
// 页面本身不再需要写 {extend} / {block}(纯动态布局)。
return [
// 开启布局(动态布局模式)
'layout_on' => true,
// 布局模板名(位于当前应用 view 目录下)
'layout_name' => 'common/layout',
// 布局替换标记:被替换为当前模板渲染结果
'layout_item' => '{__CONTENT__}',
];
+29
View File
@@ -0,0 +1,29 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
// config/jwt.php
return [
// 签名算法:HS256 / RS256
'algorithm' => 'HS256',
// 对称密钥(HS256 使用)
'secret' => env('JWT_SECRET', 'your-default-secret-key-change-in-production'),
// 非对称密钥路径(RS256 使用)
'private_key_path' => root_path() . 'keys/private.key',
'public_key_path' => root_path() . 'keys/public.key',
// Token 配置
'access_ttl' => 1800, // Access Token 有效期(秒)→ 30分钟
'refresh_ttl' => 604800, // Refresh Token 有效期(秒)→ 7天
// JWT 标准声明
'issuer' => 'https://your-app.com',
'audience' => 'https://api.your-app.com',
];
+31
View File
@@ -0,0 +1,31 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// 默认语言
'default_lang' => env('DEFAULT_LANG', 'zh-cn'),
// 允许的语言列表
'allow_lang_list' => [],
// 多语言自动侦测变量名
'detect_var' => 'lang',
// 是否使用Cookie记录
'use_cookie' => true,
// 多语言cookie变量
'cookie_var' => 'think_lang',
// 多语言header变量
'header_var' => 'think-lang',
// 扩展语言包
'extend_list' => [],
// Accept-Language转义为对应语言包名称
'accept_language' => [
'zh-hans-cn' => 'zh-cn',
],
// 是否支持语言分组
'allow_group' => true,
];
+49
View File
@@ -0,0 +1,49 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// 默认日志记录通道
'default' => 'file',
// 日志记录级别
'level' => ['info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency'],
// 日志类型记录的通道 ['error'=>'email',...]
'type_channel' => [],
// 关闭全局日志写入
'close' => false,
// 全局日志处理 支持闭包
'processor' => null,
// 日志通道列表
'channels' => [
'file' => [
// 日志记录方式
'type' => 'File',
// 日志保存目录
'path' => '',
// 单文件日志写入
'single' => false,
// 独立日志级别
'apart_level' => [],
// 最大日志文件数量
'max_files' => 30,
// 使用JSON格式记录
'json' => false,
// 日志处理
'processor' => null,
// 关闭通道日志写入
'close' => false,
// 日志输出格式化
'format' => '[%s][%s] %s',
// 是否实时写入
'realtime_write' => false,
],
// 其它日志通道配置
],
];
+25
View File
@@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
// 邮件服务配置(开发者令牌发送)
return [
// SMTP 服务器地址,如 smtp.exmail.qq.com / smtp.163.com / smtp.gmail.com
'host' => env('MAIL_HOST', ''),
// 端口,通常为 465(ssl) 或 587(tls)
'port' => env('MAIL_PORT', 465),
// 加密方式:ssl / tls
'secure' => env('MAIL_SECURE', 'ssl'),
// 发件账号(通常与用户名一致)
'username' => env('MAIL_USERNAME', ''),
// 发件密码 / 授权码
'password' => env('MAIL_PASSWORD', ''),
// 发件人邮箱
'from' => env('MAIL_FROM', ''),
// 发件人名称
'from_name' => env('MAIL_FROM_NAME', 'YwxApp 应用市场'),
];
+28
View File
@@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
/**
* 会员套餐配置
*
* 价格单位:元;duration 单位:天(会员有效时长)。
* level:会员等级(0 普通 / 1 标准 / 2 专业),写入用户表 vip_level。
* gid:开通后用户所属会员组 ID(对应 wxapp_user_group),写入用户表 gid 与 user_group_access。
*
* 该配置同时被以下位置消费:
* - app/member/controller/Payment.php(套餐列表 / 下单)
* - app/member/listener/UserMemberActivate.php(支付成功后写入会员权益)
*/
return [
'plans' => [
1 => ['id' => 1, 'title' => '免费版', 'price' => 0, 'desc' => '基础功能,1 名成员', 'level' => 0, 'gid' => 2, 'duration' => 0],
2 => ['id' => 2, 'title' => '标准版', 'price' => 99, 'desc' => '5 名成员,AI 辅助写作', 'level' => 1, 'gid' => 3, 'duration' => 30],
3 => ['id' => 3, 'title' => '专业版', 'price' => 299, 'desc' => '20 名成员,无限文章', 'level' => 2, 'gid' => 3, 'duration' => 90],
],
// 付费会员组 ID(监听器据此把用户加入该组)
'vip_group_id' => 3,
];
+29
View File
@@ -0,0 +1,29 @@
<?php
/*
* @Author: YwxApp <ywx@ywxapp.cn>
* @Date: 2026-08-06 22:05:39
* @LastEditors: YwxApp <ywx@ywxapp.cn>
* @LastEditTime: 2026-08-10 21:16:26
* @Description:
* @FilePath: \ywxapp_dev\config\middleware.php
* @CustomString: Copyright (c) 2026 YwxApp
*/
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
// 中间件配置
return [
// 全局中间件
'global' => [
// 开发环境启用插件热重载中间件
// \ywxapp\middleware\AddonHotReloadMiddleware::class,
],
// 别名或分组
'alias' => [],
// 优先级设置,此数组中的中间件会按照数组中的顺序优先执行
'priority' => [],
];
+36
View File
@@ -0,0 +1,36 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// 模拟支付开关:无商户号时直接完成下单并签发授权,便于本地/自托管环境跑通购买闭环。
// 生产环境务必在 .env 设置 PAY_MOCK=false 关闭,否则任何人可「免费」购得付费插件。
'mock_enable' => env('PAY_MOCK', true),
// 支付宝
'alipay' => [
'mode' => env('PAY_ALIPAY_MODE', 'normal'), // normal | dev | query
'app_id' => env('PAY_ALIPAY_APP_ID', ''),
'ali_public_key' => env('PAY_ALIPAY_PUBLIC_KEY', ''),
'private_key' => env('PAY_ALIPAY_PRIVATE_KEY', ''),
'return_url' => '',
'notify_url' => '',
],
// 微信支付(如需,在 buy() 中按相同方式调用 Pay::wechat(...) 即可)
'wechat' => [
'mch_id' => env('PAY_WECHAT_MCH_ID', ''),
'app_id' => env('PAY_WECHAT_APP_ID', ''),
'secret_key' => env('PAY_WECHAT_SECRET_KEY', ''),
'cert_client' => '',
'cert_key' => '',
'return_url' => '',
'notify_url' => '',
],
];
+60
View File
@@ -0,0 +1,60 @@
<?php
/*
* @Author: YwxApp <ywx@ywxapp.cn>
* @Date: 2026-08-06 22:05:39
* @LastEditors: YwxApp <ywx@ywxapp.cn>
* @LastEditTime: 2026-08-07 00:32:19
* @Description:
* @FilePath: \ywxapp_dev\config\route.php
* @CustomString: Copyright (c) 2026 YwxApp
*/
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// pathinfo分隔符
'pathinfo_depr' => '/',
// URL伪静态后缀
'url_html_suffix' => 'html',
// URL普通方式参数 用于自动生成
'url_common_param' => true,
// 是否开启路由延迟解析(插件路由用 Route::group + include_once 动态注册,与 lazy route 不兼容,关闭以保证动态段规则(如 store/detail/:name)必加载)
'url_lazy_route' => false,
// 是否强制使用路由
'url_route_must' => false,
// 合并路由规则(关闭:开启后短规则会吞掉更长的子规则,如 article 吞掉 article/create、article/edit/:id
'route_rule_merge' => false,
// 路由是否完全匹配
'route_complete_match' => true,
// 访问控制器层名称
'controller_layer' => 'controller',
// 空控制器名
'empty_controller' => 'Error',
// 是否使用控制器后缀
'controller_suffix' => false,
// 默认的路由变量规则
'default_route_pattern' => '[\w\.]+',
// 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
'request_cache_key' => false,
// 请求缓存有效期
'request_cache_expire' => null,
// 全局请求缓存排除规则
'request_cache_except' => [],
// 默认控制器名
'default_controller' => 'Index',
// 默认操作名
'default_action' => 'index',
// 操作方法后缀
'action_suffix' => '',
// 默认JSONP格式返回的处理方法
'default_jsonp_handler' => 'jsonpReturn',
// 默认JSONP处理方法
'var_jsonp_handler' => 'callback',
// 应用模块路由前缀
];
+43
View File
@@ -0,0 +1,43 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp <admin@ywxapp.cn>
// +----------------------------------------------------------------------
// | 注意:本文件原先被错误地写入了「缓存(cache)」配置结构,导致 ThinkPHP
// | 初始化 Session 时拿不到正确的配置,session 的 expire 为 0File 驱动
// | read() 的时间检查 `filemtime >= time() - expire` 恒为假,Session 永远
// | 为空,登录写入的 refresh_token 无法在后续请求中被读取,自动续期失效。
// | 这里改为正确的 Session 配置。
// +----------------------------------------------------------------------
return [
// SessionID 前缀(Cookie 名称)
'prefix' => 'PHPSESSID',
// 驱动方式
'type' => 'file',
// 是否自动启动
'auto_start' => true,
// Session 保存路径(留空则使用 runtime_path() . 'session/'backend 应用为 runtime/addon/backend/session/
'path' => '',
// Session 文件生命周期(秒)。
// 必须大于 access_token 的过期时间,否则用户空闲超过该值后 session 文件
// 会被判定过期、导致后端自动续期读不到 refresh_token 而失败。
// 设为 7 天,与 refresh_token 有效期(604800)对齐,支持长时间空闲自动续期。
'expire' => 604800,
// 是否压缩数据
'data_compress' => false,
// Cookie 域名
'domain' => '',
// 仅 HTTPS 传输
'secure' => false,
// 仅 HTTP 可见(防 XSS
'httponly' => false,
// 使用 Cookie 传递 SessionID
'use_cookies' => true,
// 客户端缓存限制
'cache_limiter' => 'nocache',
'cache_expire' => 0,
];
+43
View File
@@ -0,0 +1,43 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// 默认使用的驱动
'default' => env('FILE_STORAGE_DRIVER', 'local'),
// 各驱动详细配置
'drivers' => [
// 本地驱动配置
'local' => [
'class' => 'ywxapp\utils\storage\LocalStorage',
'root' => app()->getRootPath() . 'public/storage',
'url' => '/storage',
'visibility' => 'public',
'domain' => '', // 域名,留空自动拼接
],
// 阿里云OSS配置
'alioss' => [
'class' => 'ywxapp\utils\storage\AliOssStorage',
'access_key_id' => env('ALIOSS_ACCESS_KEY'),
'access_key_secret' => env('ALIOSS_SECRET_KEY'),
'endpoint' => env('ALIOSS_ENDPOINT'),
'bucket' => env('ALIOSS_BUCKET'),
'cdn_domain' => env('ALIOSS_CDN_DOMAIN'), // 可选
],
// 腾讯云COS配置
'qcos' => [
'class' => 'ywxapp\utils\storage\QcloudCosStorage',
'region' => env('QCOS_REGION'),
'secret_id' => env('QCOS_SECRET_ID'),
'secret_key' => env('QCOS_SECRET_KEY'),
'bucket' => env('QCOS_BUCKET'),
],
],
];
+14
View File
@@ -0,0 +1,14 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
'isEnable' => env('SYNC_IS_ENABLE', true),
'baseUrl' => env('SYNC_BASE_URL','https://sync.xixingwl.cn'),
'key' => env('SYNC_KEY','your-256-bit-secret-key-here'),
];
+29
View File
@@ -0,0 +1,29 @@
<?php
/*
* @Author: YwxApp <ywx@ywxapp.cn>
* @Date: 2026-07-28 23:30:54
* @LastEditors: YwxApp <ywx@ywxapp.cn>
* @LastEditTime: 2026-07-29 14:53:19
* @Description:
* @FilePath: \ywxapp_dev\config\template.php
* @CustomString: Copyright (c) 2026 YwxApp
*/
// +----------------------------------------------------------------------
// | YwxApp 模板激活配置
// | 整站皮肤 + 局部覆盖 + 每插件独立选(Discuz 式卖模板)
// | active_map: 插件名 => 模板名;'*' 为全局默认;
// | 值为 'default' 或空 = 使用该插件自带视图(不覆盖)。
// +----------------------------------------------------------------------
return [
'active_map' => [
// 示例:让 blog 插件使用 myblog 皮肤(需先存在 templates/myblog/
'blog' => 'myblog',
// '*' => 'default', // 全站默认模板(界面设置中可配置)
],
// 界面设置:allow_member_select=允许会员自选风格;disabled=被禁用的模板列表
'settings' => [
'allow_member_select' => false,
'disabled' => [],
],
];
+14
View File
@@ -0,0 +1,14 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// 内置Html和Console两种方式 支持扩展
'type' => 'Html',
// 读取的日志通道名
'channel' => '',
];
+62
View File
@@ -0,0 +1,62 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
'imageActionName' => 'image',
'imageFieldName' => 'file',
'imageMaxSize' => 10485760,
'imageAllowFiles' => ['.jpg', '.png', '.jpeg'],
'imageCompressEnable' => true,
'imageCompressBorder' => 5000,
'imageInsertAlign' => 'none',
'imageUrlPrefix' => '',
'scrawlActionName' => 'crawl',
'scrawlFieldName' => 'file',
'scrawlMaxSize' => 10485760,
'scrawlUrlPrefix' => '',
'scrawlInsertAlign' => 'none',
'snapscreenActionName' => 'snap',
'snapscreenUrlPrefix' => '',
'snapscreenInsertAlign' => 'none',
'catcherActionName' => 'catch',
'catcherFieldName' => 'source',
'catcherLocalDomain' => ['127.0.0.1', 'localhost'],
'catcherUrlPrefix' => '',
'catcherMaxSize' => 10485760,
'catcherAllowFiles' => ['.jpg', '.png', '.jpeg'],
'videoActionName' => 'video',
'videoFieldName' => 'file',
'videoUrlPrefix' => '',
'videoMaxSize' => 104857600,
'videoAllowFiles' => ['.mp4'],
"audioActionName" => "audio",
"audioFieldName" => "file",
"audioUrlPrefix" => "",
"audioMaxSize" => 104857600,
"audioAllowFiles" => [
".mp3",
],
'fileActionName' => 'file',
'fileFieldName' => 'file',
'fileUrlPrefix' => '',
'fileMaxSize' => 104857600,
'fileAllowFiles' => ['.zip', '.pdf', '.doc'],
'imageManagerActionName' => 'listImage',
'imageManagerListSize' => 20,
'imageManagerUrlPrefix' => '',
'imageManagerInsertAlign' => 'none',
'imageManagerAllowFiles' => ['.jpg', '.png', '.jpeg'],
'fileManagerActionName' => 'listFile',
'fileManagerUrlPrefix' => '',
'fileManagerListSize' => 20,
'fileManagerAllowFiles' => ['.zip', '.pdf', '.doc'],
'formulaConfig' => ['imageUrlTemplate' => 'https://r.latexeasy.com/image.svg?{}'],
];
+31
View File
@@ -0,0 +1,31 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
// 模板引擎类型使用Think
'type' => 'Think',
//'type' => \ywxapp\utils\ThinkView::class,
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板目录名
'view_dir_name' => 'view',
//'view_path' => app()->getRootPath().'view/',
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记
'tpl_begin' => '{',
// 模板引擎普通标签结束标记
'tpl_end' => '}',
// 标签库标签开始标记
'taglib_begin' => '{',
// 标签库标签结束标记
'taglib_end' => '}',
];
+37
View File
@@ -0,0 +1,37 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
use think\worker\websocket\Handler;
return [
'http' => [
'enable' => true,
'host' => '0.0.0.0',
'port' => 8080,
'worker_num' => 4,
'options' => [],
],
'websocket' => [
'enable' => false,
'handler' => Handler::class,
'ping_interval' => 25000,
'ping_timeout' => 60000,
],
//队列
'queue' => [
'enable' => false,
'workers' => [],
],
'hot_update' => [
'enable' => env('APP_DEBUG', false),
'name' => ['*.php'],
'include' => [app_path(), config_path(), root_path('route')],
'exclude' => [],
],
];
+90
View File
@@ -0,0 +1,90 @@
<?php
/*
* @Author: YwxApp <ywx@ywxapp.cn>
* @Date: 2026-08-06 22:05:39
* @LastEditors: YwxApp <ywx@ywxapp.cn>
* @LastEditTime: 2026-08-07 00:32:06
* @Description:
* @FilePath: \ywxapp_dev\config\ywxapp.php
* @CustomString: Copyright (c) 2026 YwxApp
*/
/*
* @Author: YwxApp <ywx@ywxapp.cn>
* @Date: 2026-04-29 02:32:33
* @LastEditors: YwxApp <ywx@ywxapp.cn>
* @LastEditTime: 2026-07-28 02:41:55
* @Description:
* @FilePath: \ywxapp_dev\config\ywxapp.php
* @CustomString: Copyright (c) 2026 YwxApp
*/
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
return [
'superAdmin' => 1,
//是否开启前台会员中心
'usercenter' => true,
//会员注册验证码类型email/mobile/wechat/text/false
'user_register_captcha' => 'text',
//登录验证码
'login_captcha' => true,
//登录失败超过10次则1天后重试
'login_failure_retry' => true,
//是否同一账号同一时间只能在一个地方登录
'login_unique' => false,
//是否开启IP变动检测
'loginip_check' => true,
//登录页默认背景图
'login_background' => '',
//是否启用多级菜单导航
'multiplenav' => false,
//是否开启多选项卡(仅在开启多级菜单时起作用)
'multipletab' => true,
//后台皮肤,为空时表示使用skin-blue-light
'adminskin' => '',
//自动检测更新
'checkupdate' => false,
//API是否允许跨域
'api_cross' => false,
//版本号
'version' => '1.0.16',
//API接口地址(本地自测:指向本机;生产部署需改回 https://www.ywxapp.cn,并确保中心站已部署含 framework 路由的新版 market
'api_url' => env('APP_API_URL', 'https://www.ywxapp.cn'),
// 是否开启多语言
'lang_switch_on' => true,
//是否允许未知来源的插件压缩包(本地离线安装需开启,配合 APP_DEBUG 跳过远程授权校验)
//安全提示:该开关仅在 APP_DEBUG=true 时才会真正跳过远程授权校验;生产环境务必保持
//APP_DEBUG=false,并可通过环境变量 ADDON_UNKNOWN_SOURCES=false 显式关闭离线安装,杜绝任意离线包直装。
'unknownsources' => env('ADDON_UNKNOWN_SOURCES', false),
//插件启用禁用时是否备份对应的全局文件
'backup_global_files' => true,
//插件纯净模式,插件启用后是否删除插件目录的application、public和assets文件夹
'addon_pure_mode' => true,
'addon_license_check' => false, // 运行期授权校验开关(true 时声明 license=>true 的付费插件需存在有效授权才加载)
// 下载签名密钥:用于 download 接口 generateSign 校验,防 license_key 泄漏后被冒用下载。
// 生产环境务必改为强随机值(建议写入 .env 的 ADDON_SECRET),并保持与 API 客户端一致。
// 生成强随机密钥示例: openssl rand -base64 64 或 bin2hex(random_bytes(32))
'addon_secret' => env('ADDON_SECRET', ''),
// 下载签名校验开关:true 时 download 接口要求请求携带合法 sign+ts(配合 generateSign)。
// 启用后 API 客户端需用 license_key 计算签名,否则下载将被拒绝。默认关闭以免破坏现有下载链路。
// 自托管市场(中心站 addon/market 插件,路由 /api/addon/*)已配套实现:客户端 AddonService::download() 在开启时自动签名;
// 启用前请确保 api_url 指向本服务器(服务端/客户端共享同一 addon_secret)。
'addon_download_sign' => false,
// 应用市场(appmall)插件的运行期配置(开发者令牌、远程开关、SSL 校验、抽成比例等)
// 已迁移至插件目录 addon/appmall/config/appmall.php(随插件分发、支持 .env 覆盖),
// 通过 config('appmall.*') 读取。
// 开发模式开关(抄 Discuz! 插件设计器):开启后后台「插件」出现「设计插件」入口,
// 可可视化创建/编辑本地插件(生成骨架、增删配置项/菜单/事件/路由、生成页面模块),改动实时生效。
// 生产环境务必保持 false(与 APP_DEBUG 解耦,独立开关)。
'developer_token' => env('DEVELOPER_TOKEN', ''),
'addon_developer' => env('ADDON_DEVELOPER', false),
'backend_login_url' => '/admin/login/index', // 后台登录页地址(app_map: admin => backend
'member_login_url' => '/user/login/index', // 会员中心登录页地址(app_map: member => frontend
];