WechatOfficialAccountValidate.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | saiadmin [ saiadmin快速开发框架 ]
  4. // +----------------------------------------------------------------------
  5. namespace plugin\saiadmin\app\validate\miniProgram;
  6. use plugin\saiadmin\basic\BaseValidate;
  7. /**
  8. * 微信公众号配置验证器
  9. */
  10. class WechatOfficialAccountValidate extends BaseValidate
  11. {
  12. protected $rule = [
  13. 'logo' => 'max:500',
  14. 'account_name' => 'require|max:64',
  15. 'description' => 'max:255',
  16. 'follow_message' => 'max:255',
  17. 'follow_url' => 'max:500',
  18. 'follow_enabled' => 'in:0,1',
  19. 'appid' => 'require|max:64',
  20. 'original_id' => 'require|max:64',
  21. 'appsecret' => 'require|max:128',
  22. 'server_url' => 'require|max:500',
  23. 'token' => 'require|max:128',
  24. 'encoding_aes_key' => 'max:128',
  25. 'encryption_mode' => 'in:1,2,3',
  26. 'free_recharge_times' => 'integer|between:0,999999',
  27. 'follow_free_recharge' => 'in:0,1',
  28. 'all_merchant_follow' => 'in:0,1',
  29. ];
  30. protected $message = [
  31. 'account_name' => '请填写正确的公众号名称',
  32. 'appid' => '请填写正确的公众号 APPID',
  33. 'original_id' => '请填写正确的公众号原始 ID',
  34. 'appsecret' => '请填写正确的公众号 AppSecret',
  35. 'server_url' => '请填写正确的服务器地址',
  36. 'token' => '请填写正确的令牌',
  37. 'encryption_mode' => '请选择正确的加密模式',
  38. 'free_recharge_times' => '免费充值次数必须是 0 至 999999 的整数',
  39. 'follow_enabled' => '关注开启状态不正确',
  40. 'follow_free_recharge' => '关注免费充值状态不正确',
  41. 'all_merchant_follow' => '所有商户关注状态不正确',
  42. ];
  43. protected $scene = [
  44. 'update' => [
  45. 'logo', 'account_name', 'description', 'follow_message', 'follow_url',
  46. 'follow_enabled', 'appid', 'original_id', 'appsecret', 'server_url', 'token',
  47. 'encoding_aes_key', 'encryption_mode', 'free_recharge_times',
  48. 'follow_free_recharge', 'all_merchant_follow',
  49. ],
  50. ];
  51. }