controller->getRoute(), self::ALLOW_LIST)) { return true; } $saas_user = SaasUser::findIdentityByAccessToken($access_token); if (empty($access_token) && $saas_user) { \Yii::$app->response->format = Response::FORMAT_JSON; \Yii::$app->response->data = [ 'code' => 401, 'msg' => '登陆失败' ]; return false; } if (!$saas_user) { \Yii::$app->response->format = Response::FORMAT_JSON; \Yii::$app->response->data = [ 'code' => 401, 'msg' => '登陆失败' ]; return false; } $admin = Admin::findOne(['type' => 'goods_agent', 'is_delete' => 0, 'saas_user_id' => $saas_user->id]); $agent_bind = AgentBind::findOne(['id' => $admin->type_id, 'type' => 1]); if (empty($admin) || empty($agent_bind)) { $agent_apply = AgentApply::findOne(['saas_user_id' => $saas_user->id, 'is_delete' => 0, 'agent_type' => 2]); if ($agent_apply) { if ((int)$agent_apply->status === 0) { \Yii::$app->response->format = Response::FORMAT_JSON; \Yii::$app->response->data = [ 'code' => 1, 'msg' => '产品代理申请单信息审核中' ]; return false; } if ((int)$agent_apply->status === 2) { \Yii::$app->response->format = Response::FORMAT_JSON; \Yii::$app->response->data = [ 'code' => 1, 'msg' => '产品代理申请单信息审核未通过' ]; return false; } } \Yii::$app->response->format = Response::FORMAT_JSON; \Yii::$app->response->data = [ 'code' => 1, 'msg' => '当前用户没有申请产品代理信息' ]; return false; } else { \Yii::$app->jwt->setAdmin($admin); \Yii::$app->response->format = Response::FORMAT_JSON; \Yii::$app->response->data = [ 'code' => 0, 'msg' => '获取成功' ]; return true; } } }