From 6b7b23618f2984b053828c737ab91c9d6d279947 Mon Sep 17 00:00:00 2001 From: lqmac Date: Thu, 2 Nov 2023 19:43:48 +0800 Subject: [PATCH] 1 --- .gitignore | 5 +- addons/alisms/config.php | 73 --------------------------- addons/epay/config.php | 70 ------------------------- application/api/controller/Common.php | 22 +++++++- application/extra/site.php | 60 ---------------------- 5 files changed, 25 insertions(+), 205 deletions(-) delete mode 100755 addons/alisms/config.php delete mode 100755 addons/epay/config.php delete mode 100755 application/extra/site.php diff --git a/.gitignore b/.gitignore index 5d153e8..6ccc2a2 100755 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,7 @@ node_modules .user.ini sftp-config.json -.DS_Store \ No newline at end of file +.DS_Store +addons/alisms/config.php +addons/epay/config.php +application/extra/site.php \ No newline at end of file diff --git a/addons/alisms/config.php b/addons/alisms/config.php deleted file mode 100755 index 04f9fc7..0000000 --- a/addons/alisms/config.php +++ /dev/null @@ -1,73 +0,0 @@ - 'key', - 'title' => '应用key', - 'type' => 'string', - 'content' => [], - 'value' => 'LTAI5tS9Xe57WwPZKvqAC3g8', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', - ], - [ - 'name' => 'secret', - 'title' => '密钥secret', - 'type' => 'string', - 'content' => [], - 'value' => '5cXgxLhZQSqpUZCPVyJqlNAOnuB67x', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', - ], - [ - 'name' => 'sign', - 'title' => '签名', - 'type' => 'string', - 'content' => [], - 'value' => '仁舟网络', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', - ], - [ - 'name' => 'template', - 'title' => '短信模板', - 'type' => 'array', - 'content' => [], - 'value' => [ - 'register' => 'SMS_242660968', - 'resetpwd' => 'SMS_242660968', - 'changepwd' => 'SMS_242660968', - 'changemobile' => 'SMS_242660968', - 'profile' => 'SMS_242660968', - 'notice' => 'SMS_242660968', - 'mobilelogin' => 'SMS_242660968', - 'bind' => 'SMS_242660968', - ], - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', - ], - [ - 'name' => '__tips__', - 'title' => '温馨提示', - 'type' => 'string', - 'content' => [], - 'value' => '应用key和密钥你可以通过 https://ak-console.aliyun.com/?spm=a2c4g.11186623.2.13.fd315777PX3tjy#/accesskey 获取', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', - ], -]; diff --git a/addons/epay/config.php b/addons/epay/config.php deleted file mode 100755 index 3386fdf..0000000 --- a/addons/epay/config.php +++ /dev/null @@ -1,70 +0,0 @@ - 'version', - 'title' => 'API版本(请勿修改该值)', - 'type' => 'radio', - 'content' => [], - 'value' => 'v2', - 'rule' => '', - 'msg' => '', - 'tip' => 'V2版本只支持微信支付V2密钥,V3版本只支持微信支付V3密钥,请勿修改该值!!!', - 'ok' => '', - 'extend' => '', - ], - [ - 'name' => 'wechat', - 'title' => '微信', - 'type' => 'array', - 'content' => [], - 'value' => [ - 'appid' => '', - 'app_id' => 'wx15043fd052209ad4', - 'app_secret' => '', - 'miniapp_id' => '', - 'mch_id' => '1656836065', - 'key' => 'LOfqDyekO4EbQmw3z8ZGPRiDmVDPd0NP', - 'key_v3' => '', - 'mode' => 'normal', - 'sub_mch_id' => '', - 'sub_appid' => '', - 'sub_app_id' => '', - 'sub_miniapp_id' => '', - 'notify_url' => '', - 'cert_client' => '/addons/epay/certs/apiclient_cert.pem', - 'cert_key' => '/addons/epay/certs/apiclient_key.pem', - 'log' => '1', - ], - 'rule' => 'required', - 'msg' => '', - 'tip' => '微信参数配置', - 'ok' => '', - 'extend' => '', - ], - [ - 'name' => 'alipay', - 'title' => '支付宝', - 'type' => 'array', - 'content' => [], - 'value' => [ - 'mode' => 'normal', - 'pid' => '', - 'app_id' => '', - 'notify_url' => '/addons/epay/api/notifyx/type/alipay', - 'return_url' => '/addons/epay/api/returnx/type/alipay', - 'private_key' => '', - 'signtype' => 'cert', - 'ali_public_key' => '', - 'app_cert_public_key' => '', - 'alipay_root_cert' => '', - 'log' => '1', - 'scanpay' => '0', - ], - 'rule' => 'required', - 'msg' => '', - 'tip' => '支付宝参数配置', - 'ok' => '', - 'extend' => '', - ], -]; diff --git a/application/api/controller/Common.php b/application/api/controller/Common.php index 1d01a6c..90bbaac 100755 --- a/application/api/controller/Common.php +++ b/application/api/controller/Common.php @@ -17,7 +17,7 @@ use think\Hook; */ class Common extends Api { - protected $noNeedLogin = ['init', 'captcha']; + protected $noNeedLogin = ['init', 'captcha','getAppidByDomain']; protected $noNeedRight = '*'; public function _initialize() @@ -161,4 +161,24 @@ class Common extends Api $captcha = new Captcha((array)Config::get('captcha')); return $captcha->entry($id); } + + public function getAppidByDomain(){ + $domain = $this->request->post("domain"); + $wx_appid = Config::get("site.wx_appid"); + if (!$wx_appid) { + $this->error("appid没有配置"); + } + $this->success('ok', ['wx_appid' => $wx_appid]); + } + + + + + + + + + + + } diff --git a/application/extra/site.php b/application/extra/site.php deleted file mode 100755 index a4e20da..0000000 --- a/application/extra/site.php +++ /dev/null @@ -1,60 +0,0 @@ - '我的网站', - 'beian' => '', - 'cdnurl' => '', - 'version' => '1.0.1', - 'timezone' => 'Asia/Shanghai', - 'forbiddenip' => '', - 'languages' => - array ( - 'backend' => 'zh-cn', - 'frontend' => 'zh-cn', - ), - 'fixedpage' => 'dashboard', - 'categorytype' => - array ( - 'default' => '默认', - 'page' => '单页', - 'article' => '文章', - 'test' => 'Test', - ), - 'configgroup' => - array ( - 'basic' => '基础配置', - 'email' => '邮件配置', - 'dictionary' => '字典配置', - 'user' => '会员配置', - 'distribution' => '分销设置', - ), - 'mail_type' => '1', - 'mail_smtp_host' => 'smtp.qq.com', - 'mail_smtp_port' => '465', - 'mail_smtp_user' => '10000', - 'mail_smtp_pass' => 'password', - 'mail_verify_type' => '2', - 'mail_from' => '10000@qq.com', - 'attachmentcategory' => - array ( - 'category1' => '分类一', - 'category2' => '分类二', - 'custom' => '自定义', - ), - 'banner' => - array ( - 0 => '/uploads/20231010/fc7f6f9b2bc96f98740942321433160f.jpeg', - 1 => '/uploads/20231010/fc7f6f9b2bc96f98740942321433160f.jpeg', - ), - 'user_buy_limit_per_day' => '5', - 'advance_user_buy_limit_per_day' => '1', - 'goods_buy_limit' => '50.01', - 'order_cancel_time' => '1200', - 'auto_shoukuan_time' => '0', - 'order_succ_image' => '/uploads/20231010/f7005536fecc1e70488e3d6c225bca1c.png', - 'entrusted_ratio' => '5.00', - 'primary_distribution' => '0.4', - 'entrustment_ratio' => '3.5', - 'wx_appid' => 'wx15043fd052209ad4', - 'wx_secrect' => '72617f22a757dc16b2fe2f182124f429', -);