<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\PicUploader\Web\Controller; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Exception\BizException; use ModStart\Core\Input\InputPackage; use ModStart\Core\Input\Response; use ModStart\Data\DataManager; use ModStart\Module\ModuleBaseController; use Module\Member\Auth\MemberUser; use Module\PicUploader\Util\PicUploaderUtil; class IndexController extends ModuleBaseController { public function index() { return $this->view('picUploader.index'); } public function save() { goto AY3tb; ew8qF: $tBuXm = InputPackage::buildFromInput(); goto V3gM1; bq0Db: if (!PicUploaderUtil::uploadPermit(MemberUser::id())) { return Response::generateError('不允许上传'); } goto ew8qF; MxpuB: BizException::throwsIfResponseError($ZrjxR); goto wvUQP; dxkty: if (Response::isError($Oj39K)) { return Response::jsonError($Oj39K['msg']); } goto Gnt1D; V3gM1: $okURS = $tBuXm->getTrimString('file'); goto FAeld; AY3tb: if (MemberUser::isNotLogin()) { return Response::generateError('请先登录'); } goto bq0Db; NH1WI: return Response::generateSuccessData(array('url' => $ZrjxR['data']['fullPath'], 'filename' => $ZrjxR['data']['data']['filename'])); goto Ja_FE; FAeld: $Oj39K = DataManager::preparePathForLocal($okURS); goto dxkty; wvUQP: ModelUtil::insert('pic_uploader_item', array('memberUserId' => MemberUser::id(), 'dataId' => $ZrjxR['data']['data']['id'])); goto NH1WI; Gnt1D: $ZrjxR = DataManager::storeTempDataByPath($okURS); goto MxpuB; Ja_FE: } }