diff --git a/crmeb/app/api/controller/wechat/WechatController.php b/crmeb/app/api/controller/wechat/WechatController.php index 862dc954..f024a3ac 100644 --- a/crmeb/app/api/controller/wechat/WechatController.php +++ b/crmeb/app/api/controller/wechat/WechatController.php @@ -108,6 +108,8 @@ class WechatController if (($strlen = stripos($wechatQrcode, 'uploads')) !== false) { $wechatQrcode = substr($wechatQrcode, $strlen); } + if (!$wechatQrcode) + return app('json')->fail('请上传二维码'); $canvas->setImageUrl($wechatQrcode)->setImageHeight(344)->setImageWidth(344)->setImageLeft(76)->setImageTop(76)->pushImageValue(); $image = $canvas->setFileName($name)->setImageType($imageType)->setPath($path)->setBackgroundWidth(500)->setBackgroundHeight(720)->starDrawChart(); return app('json')->success('ok', ['path' => $image ? $siteUrl . '/' . $image : '']); diff --git a/crmeb/crmeb/services/MiniProgramService.php b/crmeb/crmeb/services/MiniProgramService.php index 0995dea5..f97ad23a 100644 --- a/crmeb/crmeb/services/MiniProgramService.php +++ b/crmeb/crmeb/services/MiniProgramService.php @@ -11,7 +11,6 @@ use crmeb\repositories\PaymentRepositories; use EasyWeChat\Foundation\Application; use EasyWeChat\Payment\Order; use think\facade\Route as Url; -use crmeb\interfaces\ProviderInterface; use app\models\store\StoreOrder as StoreOrderRoutineModel; use app\models\user\UserRecharge; @@ -50,7 +49,7 @@ class MiniProgramService (self::$instance === null || $cache === true) && (self::$instance = new Application(self::options())); return self::$instance; } - + /** * 小程序接口 * @return \EasyWeChat\MiniProgram\MiniProgram