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
+27
View File
@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace app\member\validate;
use think\Validate;
/**
* 会员卡密兑换校验
*/
class Card extends Validate
{
protected $rule = [
'cardno' => 'require|length:6,100',
'password' => 'require|length:4,100',
];
protected $message = [
'cardno.require' => '请输入卡号',
'cardno.length' => '卡号格式不正确',
'password.require' => '请输入密码',
'password.length' => '密码格式不正确',
];
protected $scene = [
'redeem' => ['cardno', 'password'],
];
}
+45
View File
@@ -0,0 +1,45 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
declare (strict_types = 1);
namespace app\member\validate;
use think\Validate;
/**
* Login 类
*
* @author ywxapp <admin@ywxapp.cn>
*/
class Login extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [
'username|用户名' => 'require|max:25',
'password|密码' => 'require',
'captcha|验证码' => 'require|captcha',
];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [
'username.require' => '请输入用户名',
'username.max' => '名称最多不能超过25个字符',
'password.require' => '密码错误',
];
}
+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>
// +----------------------------------------------------------------------
declare (strict_types = 1);
namespace app\member\validate;
use think\Validate;
/**
* Payment 类
*
* @author ywxapp <admin@ywxapp.cn>
*/
class Payment extends Validate
{
/**
* 创建支付订单校验
* 字段:plan_id 套餐ID(必填正整数) / method 支付方式(付费套餐必填)
*/
protected $rule = [
'plan_id' => 'require|integer|gt:0',
'method' => 'alphaDash',
];
protected $message = [
'plan_id.require' => '请选择套餐',
'plan_id.integer' => '套餐参数错误',
'plan_id.gt' => '套餐参数错误',
'method.alphaDash' => '支付方式参数错误',
];
}
+45
View File
@@ -0,0 +1,45 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
declare (strict_types = 1);
namespace app\member\validate;
use think\Validate;
/**
* Profile 类
*
* @author ywxapp <admin@ywxapp.cn>
*/
class Profile extends Validate
{
/**
* 个人资料保存校验
* 字段:nickname 昵称 / email 邮箱 / mobile 手机号(均选填,但填写时需合规)
*/
protected $rule = [
'nickname' => 'chsDash|length:2,20',
'email' => 'email',
'mobile' => 'regex:/^1[3-9]\d{9}$/',
];
protected $message = [
'nickname.chsDash' => '昵称只能包含中文、字母、数字及 _-',
'nickname.length' => '昵称长度需在 2-20 位',
'email.email' => '邮箱格式不正确',
'mobile.regex' => '手机号格式不正确',
];
/**
* 修改密码校验
*/
protected $scene = [
'password' => ['old_password' => 'require', 'password' => 'require|length:6,20', 'password_confirm' => 'require|confirm:password'],
];
}
+46
View File
@@ -0,0 +1,46 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
declare (strict_types = 1);
namespace app\member\validate;
use think\Validate;
/**
* Register 类
*
* @author ywxapp <admin@ywxapp.cn>
*/
class Register extends Validate
{
/**
* 注册表单校验规则(与前端 register/index.html 字段一致)
* 字段:cellphone 手机号 / vercode 短信验证码 / password / repass 确认密码 / nickname 昵称 / agreement 协议
*/
protected $rule = [
'cellphone' => 'require|regex:/^1[3-9]\d{9}$/',
'vercode' => 'require|length:4,6',
'password' => 'require|length:6,20',
'repass' => 'require|confirm:password',
'nickname' => 'require|length:2,20',
'agreement' => 'accepted',
];
protected $message = [
'cellphone.require' => '请输入手机号',
'cellphone.regex' => '手机号格式不正确',
'vercode.require' => '请输入短信验证码',
'password.require' => '请输入密码',
'password.length' => '密码长度需在 6-20 位',
'repass.confirm' => '两次输入的密码不一致',
'nickname.require' => '请输入昵称',
'nickname.chsDash' => '昵称只能包含中文、字母、数字及 _-',
'agreement.accepted' => '请先同意用户协议',
];
}
+35
View File
@@ -0,0 +1,35 @@
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
declare (strict_types = 1);
namespace app\member\validate;
use think\Validate;
/**
* Settings 类
*
* @author ywxapp <admin@ywxapp.cn>
*/
class Settings extends Validate
{
/**
* 账户设置保存校验(nickname/email 选填,填写时需合规)
*/
protected $rule = [
'nickname' => 'chsDash|length:2,20',
'email' => 'email',
];
protected $message = [
'nickname.chsDash' => '昵称只能包含中文、字母、数字及 _-',
'nickname.length' => '昵称长度需在 2-20 位',
'email.email' => '邮箱格式不正确',
];
}