截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Hfdg.php 3.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop开源商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | gitee下载:https://gitee.com/likeshop_gitee
  7. // | github下载:https://github.com/likeshop-github
  8. // | 访问官网:https://www.likeshop.cn
  9. // | 访问社区:https://home.likeshop.cn
  10. // | 访问手册:http://doc.likeshop.cn
  11. // | 微信公众号:likeshop技术社区
  12. // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
  13. // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
  14. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  15. // | likeshop团队版权所有并拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshop.cn.team
  18. // +----------------------------------------------------------------------
  19. namespace app\admin\controller\setting;
  20. use app\admin\validate\setting\HfdgValidate;
  21. use app\common\basics\AdminBase;
  22. use app\common\server\ConfigServer;
  23. use app\common\server\DouGong\pay\MerchantBusinessConfig;
  24. use app\common\server\JsonServer;
  25. use app\common\server\WeChatServer;
  26. use think\response\Json;
  27. use think\response\View;
  28. /**
  29. * @notes 汇付斗拱
  30. * author lbzy
  31. * @datetime 2023-10-20 15:18:33
  32. * @class Hfdg
  33. * @package app\admin\controller\setting
  34. */
  35. class Hfdg extends AdminBase
  36. {
  37. /**
  38. * @notes 开发设置
  39. * @return Json|View
  40. * @author lbzy
  41. * @datetime 2023-10-20 15:19:41
  42. */
  43. function dev_set()
  44. {
  45. if (request()->isAjax()) {
  46. (new HfdgValidate())->goCheck('DevSet');
  47. ConfigServer::set('hfdg_dev_set', 'sys_id', input('sys_id'));
  48. ConfigServer::set('hfdg_dev_set', 'product_id', input('product_id'));
  49. ConfigServer::set('hfdg_dev_set', 'huifu_id', input('huifu_id'));
  50. ConfigServer::set('hfdg_dev_set', 'rsa_merch_private_key', input('rsa_merch_private_key'));
  51. ConfigServer::set('hfdg_dev_set', 'rsa_merch_public_key', input('rsa_merch_public_key'));
  52. ConfigServer::set('hfdg_dev_set', 'rsa_huifu_public_key', input('rsa_huifu_public_key'));
  53. return JsonServer::success('保存成功');
  54. }
  55. return view('', [ 'config' => ConfigServer::get('hfdg_dev_set') ]);
  56. }
  57. /**
  58. * @notes 微信商户设置
  59. * @return Json|View
  60. * @author lbzy
  61. * @datetime 2023-10-26 17:18:54
  62. */
  63. private function wechat_set()
  64. {
  65. if (request()->isAjax()) {
  66. if (empty(input('oa_app_id')) || empty(input('mnp_app_id'))) {
  67. return JsonServer::error('请先设置微信相关渠道');
  68. }
  69. $result = (new MerchantBusinessConfig(input()))->request()->getConfigResult();
  70. if ($result['code'] == 1) {
  71. return JsonServer::success('设置成功');
  72. } else {
  73. return JsonServer::error($result['msg']);
  74. }
  75. }
  76. return view('', [
  77. 'oa_app_id' => WeChatServer::getOaConfig()['app_id'] ?? '',
  78. 'mnp_app_id' => WeChatServer::getMnpConfig()['app_id'] ?? '',
  79. ]);
  80. }
  81. }