From 06a563c1ddc1d8af428ca682a2432b22f3355dc3 Mon Sep 17 00:00:00 2001 From: Gosowong <1329847115@qq.com> Date: Tue, 16 May 2023 18:15:53 +0800 Subject: [PATCH 01/11] =?UTF-8?q?fix:=20=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=20=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B7=B3=E8=BD=AC=E8=B7=AF=E5=BE=84=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=94=B6=E8=B4=A7=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crmeb/services/app/MiniProgramService.php | 29 +++++++++---------- .../easywechat/orderShipping/BaseOrder.php | 2 ++ .../orderShipping/MiniOrderService.php | 7 ++--- .../easywechat/orderShipping/OrderClient.php | 3 ++ 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/crmeb/crmeb/services/app/MiniProgramService.php b/crmeb/crmeb/services/app/MiniProgramService.php index eb3c14c18..620eacf9d 100644 --- a/crmeb/crmeb/services/app/MiniProgramService.php +++ b/crmeb/crmeb/services/app/MiniProgramService.php @@ -11,6 +11,7 @@ namespace crmeb\services\app; +use app\services\order\StoreOrderTakeServices; use crmeb\exceptions\AdminException; use crmeb\services\SystemConfigService; use app\services\pay\PayNotifyServices; @@ -108,7 +109,7 @@ class MiniProgramService 'log' => [ 'level' => 'debug', 'permission' => 0777, - 'file' => '/www/wwwroot/bz.wuht.net/crmeb/crmeb/runtime/log', + 'file' => '/www/wwwroot/bz.wuht.net/crmeb/crmeb/runtime/log/easywechat.log', ], ]; $config['mini_program'] = [ @@ -880,26 +881,22 @@ class MiniProgramService switch ($message->MsgType) { case 'event': switch (strtolower($message->Event)) { - case 'trade_manage_remind_access_api': - Log::error('event1'); + case 'trade_manage_remind_access_api': // 小程序完成账期授权时 小程序产生第一笔交易时 已产生交易但从未发货的小程序,每天一次 break; - case 'trade_manage_remind_shipping': - Log::error('event2'); + case 'trade_manage_remind_shipping': // 曾经发过货的小程序,订单超过48小时未发货时 break; - case 'trade_manage_order_settlement': - Log::error('event3'); + case 'trade_manage_order_settlement': // 订单完成发货时 订单结算时 + if (isset($message['estimated_settlement_time'])) { //订单完成发货时 + + } + if (isset($message['confirm_receive_method'])) { // 订单结算时 + /** @var StoreOrderTakeServices $StoreOrderTakeServices */ + $storeOrderTakeServices = app()->make(StoreOrderTakeServices::class); + $storeOrderTakeServices->takeOrder($message['merchant_trade_no'], 0); + } break; }; break; - case 'trade_manage_remind_access_api': - Log::error('notevent1'); - break; - case 'trade_manage_remind_shipping': - Log::error('notevent2'); - break; - case 'trade_manage_order_settlement': - Log::error('notevent3'); - break; }; }); } diff --git a/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php b/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php index 599c22d13..8d7100e5f 100644 --- a/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php +++ b/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php @@ -19,6 +19,8 @@ class BaseOrder extends AbstractAPI const ORDER = 'wxa/sec/order/'; const EXPRESS = 'cgi-bin/express/delivery/open_msg/'; + const PATH = '/pages/goods/order_details/index'; + public function __construct(AccessToken $accessToken, $config) { diff --git a/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php b/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php index 7e5bed349..5541b27a6 100644 --- a/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php +++ b/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php @@ -8,7 +8,6 @@ use EasyWeChat\Core\Exceptions\HttpException; class MiniOrderService { - /** * @var Application */ @@ -25,11 +24,11 @@ class MiniOrderService { $payment = SystemConfigService::more(['routine_appId', 'routine_appsecret', 'pay_weixin_mchid', 'pay_new_weixin_open', 'pay_new_weixin_mchid']); return [ - 'debug' => true, + 'debug' => true, 'log' => [ - 'level' => 'debug', + 'level' => 'debug', 'permission' => 0777, - 'file' => '/www/wwwroot/bz.wuht.net/crmeb/crmeb/runtime/log', + 'file' => '/www/wwwroot/bz.wuht.net/crmeb/crmeb/runtime/log/easywechat.log', ], 'mini_program' => [ 'app_id' => $payment['routine_appId'] ?? '', diff --git a/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php b/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php index 774da617d..c3dee6f57 100644 --- a/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php +++ b/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php @@ -103,6 +103,9 @@ class OrderClient extends BaseOrder 'contact' => $contact ]; } + + // 跳转路径 + $this->setMesJumpPath(self::PATH . '?order_id=' . $out_trade_no); return $this->shipping($params); } From 3f6dbba7bb49d10bec1e5178e71e975c82cb44f8 Mon Sep 17 00:00:00 2001 From: Gosowong <1329847115@qq.com> Date: Tue, 16 May 2023 18:34:56 +0800 Subject: [PATCH 02/11] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php b/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php index 8d7100e5f..def23811c 100644 --- a/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php +++ b/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php @@ -166,7 +166,7 @@ class BaseOrder extends AbstractAPI $params = [ 'appid' => $this->config['config']['mini_program']['app_id'] ]; - return $this->resultHandle($this->parseJSON('POST', [self::BASE_API . self::ORDER . 'notify_confirm_receive', json_encode($params)])); + return $this->resultHandle($this->parseJSON('POST', [self::BASE_API . self::ORDER . 'is_trade_managed', json_encode($params)])); } /** From ea2250d002140b51da7abba34ed58d157d07bb25 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Tue, 16 May 2023 19:00:10 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0rsa=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/Login.php | 19 ++- crmeb/crmeb/utils/Rsa.php | 194 ++++++++++++++++++++++++ 2 files changed, 211 insertions(+), 2 deletions(-) create mode 100644 crmeb/crmeb/utils/Rsa.php diff --git a/crmeb/app/adminapi/controller/Login.php b/crmeb/app/adminapi/controller/Login.php index b47a2f0ab..2239de764 100644 --- a/crmeb/app/adminapi/controller/Login.php +++ b/crmeb/app/adminapi/controller/Login.php @@ -11,9 +11,11 @@ namespace app\adminapi\controller; use crmeb\services\CacheService; +use crmeb\utils\Rsa; use think\facade\App; use crmeb\utils\Captcha; use app\services\system\admin\SystemAdminServices; +use think\facade\Cache; /** * 后台登陆 @@ -83,7 +85,7 @@ class Login extends AuthController * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ - public function login() + public function login(Rsa $rsa) { [$account, $password, $key, $captchaVerification, $captchaType] = $this->request->postMore([ 'account', @@ -102,9 +104,10 @@ class Login extends AuthController } $this->validate(['account' => $account, 'pwd' => $password], \app\adminapi\validate\setting\SystemAdminValidata::class, 'get'); + $password = $rsa->privateDecrypt($password); $result = $this->services->login($account, $password, 'admin', $key); if (!$result) { - $num = CacheService::get('login_captcha',1); + $num = CacheService::get('login_captcha', 1); if ($num > 1) { return app('json')->fail(400140, ['login_captcha' => 1]); } @@ -123,4 +126,16 @@ class Login extends AuthController { return app('json')->success($this->services->getLoginInfo()); } + + /** + * 获取 + * @return \think\Response + * @author 等风来 + * @email 136327134@qq.com + * @date 2023/5/16 + */ + public function key(Rsa $rsa) + { + return app('json')->success(['publicKey' => $rsa->getPublicKey()]); + } } diff --git a/crmeb/crmeb/utils/Rsa.php b/crmeb/crmeb/utils/Rsa.php new file mode 100644 index 000000000..a169bf26e --- /dev/null +++ b/crmeb/crmeb/utils/Rsa.php @@ -0,0 +1,194 @@ + + * +---------------------------------------------------------------------- + */ + +namespace crmeb\utils; + +/** + * Class Rsa + * @author 等风来 + * @email 136327134@qq.com + * @date 2023/5/16 + * @package crmeb\utils + */ +class Rsa +{ + /** + * @var string + */ + protected $publicKey; + + /** + * @var string + */ + protected $privateKey; + + /** + * @var string + */ + protected $basePath; + + /** + * 获取证书文件 + * @param $publicKey + * @param $privateKey + */ + public function __construct(string $publicKey = 'cert_public_password.key', string $privateKey = 'cert_private_password.key') + { + $this->basePath = runtime_path(); + if ($publicKey) { + $this->publicKey = $this->basePath . $publicKey; + } + if ($privateKey) { + $this->privateKey = $this->basePath . $publicKey; + } + if (!is_file($this->publicKey) || !is_file($this->privateKey)) { + $this->exportOpenSSLFile(); + } + } + + /** + * @return false|string + * @author 等风来 + * @email 136327134@qq.com + * @date 2023/5/16 + */ + public function getPublicKey() + { + if (!is_file($this->publicKey)) { + $this->exportOpenSSLFile(); + } + + return file_get_contents($this->publicKey); + } + + /** + * 生成证书 + * @return bool + */ + public function exportOpenSSLFile($passwork = null) + { + + $publicKey = $privateKey = ''; + $dir = runtime_path() . 'conf'; + $conf = 'openssl.cnf'; + if (!is_dir($dir)) { + mkdir($dir, 0700); + } + if (!file_exists($conf)) { + touch($dir . '/' . $conf); + } + + //参数设置 + $config = [ + "digest_alg" => "sha256", + //字节数 512 1024 2048 4096 等 + "private_key_bits" => 1024, + "config" => $dir . '/' . $conf, + //加密类型 + "private_key_type" => OPENSSL_KEYTYPE_RSA, + ]; + + //创建私钥和公钥 + $res = openssl_pkey_new($config); + if ($res == false) { + //创建失败,请检查openssl.cnf文件是否存在 + return false; + } + + //将密钥导出为PEM编码的字符串,并输出(通过引用传递)。 + openssl_pkey_export($res, $privateKey, $passwork, $config); + $publicKey = openssl_pkey_get_details($res); + $publicKey = $publicKey["key"]; + + //生成证书 + $createPublicFileRet = file_put_contents($this->publicKey, $publicKey); + $createPrivateFileRet = file_put_contents($this->privateKey, $privateKey); + if (!($createPublicFileRet || $createPrivateFileRet)) { + return false; + } + + openssl_free_key($res); + return true; + } + + /** + * 数据加密 + * @param string $data + * @param string|null $passwork + * @return false|string + * @author 等风来 + * @email 136327134@qq.com + * @date 2023/5/16 + */ + function privateEncrypt(string $data, string $passwork = null) + { + $encrypted = ''; + $pi_key = openssl_pkey_get_private(file_get_contents($this->privateKey), $passwork);//这个函数可用来判断私钥是否是可用的,可用返回资源id Resource id + //最大允许加密长度为117,得分段加密 + $plainData = str_split($data, 100);//生成密钥位数 1024 bit key + foreach ($plainData as $chunk) { + $partialEncrypted = ''; + $encryptionOk = openssl_private_encrypt($chunk, $partialEncrypted, $pi_key);//私钥加密 + if ($encryptionOk === false) { + return false; + } + $encrypted .= $partialEncrypted; + } + + $encrypted = base64_encode($encrypted);//加密后的内容通常含有特殊字符,需要编码转换下,在网络间通过url传输时要注意base64编码是否是url安全的 + return $encrypted; + } + + /** + * RSA公钥解密(私钥加密的内容通过公钥可以解密出来) + * @param string $public_key 公钥 + * @param string $data 私钥加密后的字符串 + * @return string $decrypted 返回解密后的字符串 + * @author mosishu + */ + function publicDecrypt(string $data) + { + $decrypted = ''; + $pu_key = openssl_pkey_get_public(file_get_contents($this->publicKey));//这个函数可用来判断公钥是否是可用的 + $plainData = str_split(base64_decode($data), 128);//生成密钥位数 1024 bit key + foreach ($plainData as $chunk) { + $str = ''; + $decryptionOk = openssl_public_decrypt($chunk, $str, $pu_key);//公钥解密 + if ($decryptionOk === false) { + return false; + } + $decrypted .= $str; + } + return $decrypted; + } + + /** + * 私钥解密 + * @param string $data + * @return mixed + * @author 等风来 + * @email 136327134@qq.com + * @date 2023/5/16 + */ + public function privateDecrypt(string $data) + { + if (!is_file($this->privateKey)) { + $this->exportOpenSSLFile(); + } + + openssl_private_decrypt(base64_decode($data), $decryptedData, file_get_contents($this->privateKey)); + + return $decryptedData; + } + +} From 234724abb65a5f1ea13ca8743b96d46493009136 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Wed, 17 May 2023 09:02:46 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E8=AF=81=E4=B9=A6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/Login.php | 8 +++++++- crmeb/app/adminapi/route/route.php | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crmeb/app/adminapi/controller/Login.php b/crmeb/app/adminapi/controller/Login.php index 2239de764..12325a2f3 100644 --- a/crmeb/app/adminapi/controller/Login.php +++ b/crmeb/app/adminapi/controller/Login.php @@ -104,7 +104,13 @@ class Login extends AuthController } $this->validate(['account' => $account, 'pwd' => $password], \app\adminapi\validate\setting\SystemAdminValidata::class, 'get'); - $password = $rsa->privateDecrypt($password); + + try { + $password = $rsa->privateDecrypt($password); + } catch (\Throwable $e) { + return app('json')->fail($e->getMessage()); + } + $result = $this->services->login($account, $password, 'admin', $key); if (!$result) { $num = CacheService::get('login_captcha', 1); diff --git a/crmeb/app/adminapi/route/route.php b/crmeb/app/adminapi/route/route.php index bcb82d491..b67a58968 100644 --- a/crmeb/app/adminapi/route/route.php +++ b/crmeb/app/adminapi/route/route.php @@ -24,6 +24,8 @@ Route::group(function () { Route::post('login', 'Login/login')->name('AdminLogin')->option(['real_name' => '下载表备份记录']); //后台登录页面数据 Route::get('login/info', 'Login/info')->option(['real_name' => '登录信息']); + //获取公钥证书信息 + Route::get('login/key', 'Login/key')->option(['real_name' => '获取公钥证书信息']); //下载文件 Route::get('download/:key', 'PublicController/download')->option(['real_name' => '下载文件']); //验证码 From 74ee389b1df54b3b5eb471d8dbb6159e116b422f Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Wed, 17 May 2023 09:03:48 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=81=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/Login.php | 14 +------------- crmeb/app/adminapi/route/route.php | 2 -- .../services/system/admin/SystemAdminServices.php | 4 +++- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/crmeb/app/adminapi/controller/Login.php b/crmeb/app/adminapi/controller/Login.php index 12325a2f3..facc90cd8 100644 --- a/crmeb/app/adminapi/controller/Login.php +++ b/crmeb/app/adminapi/controller/Login.php @@ -110,7 +110,7 @@ class Login extends AuthController } catch (\Throwable $e) { return app('json')->fail($e->getMessage()); } - + $result = $this->services->login($account, $password, 'admin', $key); if (!$result) { $num = CacheService::get('login_captcha', 1); @@ -132,16 +132,4 @@ class Login extends AuthController { return app('json')->success($this->services->getLoginInfo()); } - - /** - * 获取 - * @return \think\Response - * @author 等风来 - * @email 136327134@qq.com - * @date 2023/5/16 - */ - public function key(Rsa $rsa) - { - return app('json')->success(['publicKey' => $rsa->getPublicKey()]); - } } diff --git a/crmeb/app/adminapi/route/route.php b/crmeb/app/adminapi/route/route.php index b67a58968..bcb82d491 100644 --- a/crmeb/app/adminapi/route/route.php +++ b/crmeb/app/adminapi/route/route.php @@ -24,8 +24,6 @@ Route::group(function () { Route::post('login', 'Login/login')->name('AdminLogin')->option(['real_name' => '下载表备份记录']); //后台登录页面数据 Route::get('login/info', 'Login/info')->option(['real_name' => '登录信息']); - //获取公钥证书信息 - Route::get('login/key', 'Login/key')->option(['real_name' => '获取公钥证书信息']); //下载文件 Route::get('download/:key', 'PublicController/download')->option(['real_name' => '下载文件']); //验证码 diff --git a/crmeb/app/services/system/admin/SystemAdminServices.php b/crmeb/app/services/system/admin/SystemAdminServices.php index 0cacdc8bc..de07b3bcd 100644 --- a/crmeb/app/services/system/admin/SystemAdminServices.php +++ b/crmeb/app/services/system/admin/SystemAdminServices.php @@ -23,6 +23,7 @@ use app\services\system\SystemMenusServices; use crmeb\services\CacheService; use crmeb\services\FormBuilder; use crmeb\services\workerman\ChannelService; +use crmeb\utils\Rsa; use think\facade\Config; use think\facade\Event; use think\Model; @@ -167,7 +168,8 @@ class SystemAdminServices extends BaseServices 'copyright' => sys_config('nncnL_crmeb_copyright', ''), 'version' => get_crmeb_version(), 'key' => $key, - 'login_captcha' => 0 + 'login_captcha' => 0, + 'publicKey' => app()->make(Rsa::class)->getPublicKey() ]; if (CacheService::get('login_captcha', 1) > 1) { $data['login_captcha'] = 1; From 9931498adf9873fa6582543cad865ad92e136de8 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Wed, 17 May 2023 09:08:31 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/crmeb/utils/Rsa.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crmeb/crmeb/utils/Rsa.php b/crmeb/crmeb/utils/Rsa.php index a169bf26e..05950e52f 100644 --- a/crmeb/crmeb/utils/Rsa.php +++ b/crmeb/crmeb/utils/Rsa.php @@ -79,7 +79,7 @@ class Rsa { $publicKey = $privateKey = ''; - $dir = runtime_path() . 'conf'; + $dir = app()->getRootPath() . 'runtime/conf'; $conf = 'openssl.cnf'; if (!is_dir($dir)) { mkdir($dir, 0700); From 46248604af16423f1426d76eb56dcde3f442d729 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Wed, 17 May 2023 09:09:22 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/crmeb/utils/Rsa.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crmeb/crmeb/utils/Rsa.php b/crmeb/crmeb/utils/Rsa.php index 05950e52f..a02074676 100644 --- a/crmeb/crmeb/utils/Rsa.php +++ b/crmeb/crmeb/utils/Rsa.php @@ -44,7 +44,7 @@ class Rsa */ public function __construct(string $publicKey = 'cert_public_password.key', string $privateKey = 'cert_private_password.key') { - $this->basePath = runtime_path(); + $this->basePath = app()->getRootPath(); if ($publicKey) { $this->publicKey = $this->basePath . $publicKey; } From 767acd52f8100fee6f37ff7a7639c39e045546e0 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Wed, 17 May 2023 09:12:47 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E8=A7=A3=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/Login.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crmeb/app/adminapi/controller/Login.php b/crmeb/app/adminapi/controller/Login.php index b34ea6055..f5ab988f4 100644 --- a/crmeb/app/adminapi/controller/Login.php +++ b/crmeb/app/adminapi/controller/Login.php @@ -107,13 +107,14 @@ class Login extends AuthController } } - $this->validate(['account' => $account, 'pwd' => $password], \app\adminapi\validate\setting\SystemAdminValidata::class, 'get'); - try { $password = $rsa->privateDecrypt($password); } catch (\Throwable $e) { return app('json')->fail($e->getMessage()); } + + $this->validate(['account' => $account, 'pwd' => $password], \app\adminapi\validate\setting\SystemAdminValidata::class, 'get'); + $result = $this->services->login($account, $password, 'admin', $key); if (!$result) { From 488e32afa190902e146d87925cb666848f9a1668 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Wed, 17 May 2023 09:25:55 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E8=A7=A3=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/Login.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crmeb/app/adminapi/controller/Login.php b/crmeb/app/adminapi/controller/Login.php index f5ab988f4..575942a87 100644 --- a/crmeb/app/adminapi/controller/Login.php +++ b/crmeb/app/adminapi/controller/Login.php @@ -95,9 +95,6 @@ class Login extends AuthController ['captchaType', ''] ], true); - if (strlen(trim($password)) < 6 || strlen(trim($password)) > 32) { - return app('json')->fail(400762); - } if ($captchaVerification != '') { try { @@ -112,7 +109,11 @@ class Login extends AuthController } catch (\Throwable $e) { return app('json')->fail($e->getMessage()); } - + + if (strlen(trim($password)) < 6 || strlen(trim($password)) > 32) { + return app('json')->fail(400762); + } + $this->validate(['account' => $account, 'pwd' => $password], \app\adminapi\validate\setting\SystemAdminValidata::class, 'get'); From f20d2f3d3c278ae1c15936001b6661b120cd3163 Mon Sep 17 00:00:00 2001 From: Gosowong <1329847115@qq.com> Date: Wed, 17 May 2023 09:29:37 +0800 Subject: [PATCH 10/11] =?UTF-8?q?feat:=20=E8=AE=A2=E5=8D=95=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=B7=BB=E5=8A=A0=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=AE=A1=E7=90=86=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/services/order/StoreOrderServices.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crmeb/app/services/order/StoreOrderServices.php b/crmeb/app/services/order/StoreOrderServices.php index a316bd0bf..23be2afad 100644 --- a/crmeb/app/services/order/StoreOrderServices.php +++ b/crmeb/app/services/order/StoreOrderServices.php @@ -35,6 +35,7 @@ use crmeb\exceptions\AdminException; use crmeb\exceptions\ApiException; use crmeb\exceptions\PayException; use crmeb\services\CacheService; +use crmeb\services\easywechat\orderShipping\MiniOrderService; use crmeb\services\FormBuilder as Form; use crmeb\services\printer\Printer; use crmeb\services\SystemConfigService; @@ -2495,6 +2496,11 @@ HTML; 'help_status' => 1 ]; } + // 判断是否开启小程序订单管理 + $orderData['order_shipping_open'] = false; + if (sys_config('order_shipping_open', 0) && MiniOrderService::isManaged()) { + $orderData['order_shipping_open'] = true; + } return $orderData; } From e497156675806ac922159dd1376ed5b1793c4e17 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Wed, 17 May 2023 09:49:10 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E8=A7=A3=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/Login.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crmeb/app/adminapi/controller/Login.php b/crmeb/app/adminapi/controller/Login.php index 575942a87..e3e9d877a 100644 --- a/crmeb/app/adminapi/controller/Login.php +++ b/crmeb/app/adminapi/controller/Login.php @@ -105,6 +105,9 @@ class Login extends AuthController } try { + if (strlen(trim($password)) > 500) { + return app('json')->fail(400762); + } $password = $rsa->privateDecrypt($password); } catch (\Throwable $e) { return app('json')->fail($e->getMessage());