<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Photo\Web\Controller; use ModStart\Core\Exception\BizException; use ModStart\Core\Input\InputPackage; use ModStart\Core\Input\Request; use ModStart\Core\Input\Response; use Module\Photo\Type\PhotoCategoryType; use Module\Photo\Type\PhotoCategoryVisitType; use Module\Photo\Util\PhotoAuthUtil; use Module\Photo\Util\PhotoCategoryUtil; class PhotoController extends BaseController { private $api; public function __construct() { $this->api = app(\Module\Photo\Api\Controller\PhotoController::class); } public function index() { if ($YE7wE = $this->authCheck()) { return $YE7wE; } return $this->view('photo.index', array('categories' => \Module\Photo\Util\PhotoCategoryUtil::listCategories())); } public function category($DcXJr) { goto Eew5Q; bQNfq: if ($ar_Ag['visitType'] == PhotoCategoryVisitType::VISIT_PASSWORD) { if (!PhotoAuthUtil::isAuth($DcXJr)) { if (Request::isPost()) { goto q0sGR; q0sGR: $fAvwi = InputPackage::buildFromInput(); goto q4Ihh; DQN_F: return Response::redirect('[reload]'); goto VyJZ6; dH_3L: PhotoAuthUtil::putAuth($ar_Ag['id']); goto DQN_F; Hu9cO: if ($gQvAP != $ar_Ag['visitPass']) { return Response::jsonError('访问密码不正确'); } goto dH_3L; q4Ihh: $gQvAP = $fAvwi->getTrimString('password'); goto Hu9cO; VyJZ6: } else { return $this->view('photo.auth'); } } } goto TR41G; Eew5Q: if ($YE7wE = $this->authCheck()) { return $YE7wE; } goto Wxt1N; TR41G: $q62oK = array('category' => $ar_Ag); goto t4A9e; t4A9e: switch ($ar_Ag['type']) { case PhotoCategoryType::VIDEO: return $this->view('photo.categoryVideo', $q62oK); default: return $this->view('photo.category', $q62oK); } goto xShJ3; Wxt1N: $ar_Ag = PhotoCategoryUtil::get($DcXJr); goto Uxah6; Uxah6: BizException::throwsIfEmpty('分类不存在', $ar_Ag); goto bQNfq; xShJ3: } }