From d16907319736af026045b7973f338b69b5eef084 Mon Sep 17 00:00:00 2001 From: kbdxbt <1194174530@qq.com> Date: Sun, 1 Sep 2019 16:04:49 +0800 Subject: [PATCH] fix --- api/modules/v1/controllers/MiniProgramController.php | 2 +- common/helpers/UploadHelper.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api/modules/v1/controllers/MiniProgramController.php b/api/modules/v1/controllers/MiniProgramController.php index 237d3544f..b29ea416c 100644 --- a/api/modules/v1/controllers/MiniProgramController.php +++ b/api/modules/v1/controllers/MiniProgramController.php @@ -85,7 +85,7 @@ public function actionDecode() // 插入到用户授权表 if (!($memberAuthInfo = Yii::$app->services->memberAuth->findOauthClient(Auth::CLIENT_MINI_PROGRAM, $userinfo['openId']))) { - Yii::$app->services->memberAuth->create([ + $memberAuthInfo = Yii::$app->services->memberAuth->create([ 'unionid' => $userinfo['unionId'] ?? '', 'oauth_client' => Auth::CLIENT_MINI_PROGRAM, 'oauth_client_user_id' => $userinfo['openId'], diff --git a/common/helpers/UploadHelper.php b/common/helpers/UploadHelper.php index afd54d4df..c8b70bc16 100644 --- a/common/helpers/UploadHelper.php +++ b/common/helpers/UploadHelper.php @@ -137,6 +137,9 @@ public function __construct(array $config, $type, $superaddition = false) public function verifyFile() { $file = UploadedFile::getInstanceByName($this->uploadFileName); + if (!$file) { + throw new NotFoundHttpException('找不到上传文件'); + } if ($file->getHasError()) { throw new NotFoundHttpException('上传失败,请检查文件'); }