<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\PicUploader\Web\Controller; use ModStart\Core\Assets\AssetsUtil; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Input\InputPackage; use ModStart\Core\Input\Response; use ModStart\Data\DataManager; use ModStart\Module\ModuleBaseController; use Module\PicUploader\Util\PicUploaderUtil; class TokenController extends ModuleBaseController { public function index($ufeje) { goto Xqf4k; l8mqw: if (empty($V0Dls)) { return Response::jsonError('content为空'); } goto rzI7P; TYXB6: $tBuXm = InputPackage::buildFromInput(); goto Iek44; i4XxZ: if (empty($t68n7) || empty($t68n7['uploadTokenEnable'])) { return Response::jsonError('用户不存在或接口上传未开启'); } goto UkfZy; gTG4H: return Response::jsonSuccessData(array('fullPath' => AssetsUtil::fixFull($ZrjxR['data']['fullPath'], false))); goto SKLET; qSYJ4: if (Response::isError($ZrjxR)) { return Response::jsonError($ZrjxR['msg']); } goto ANHxd; Fsh3f: if (empty($v3nkx)) { return Response::jsonError('filename为空'); } goto l8mqw; Iek44: $v3nkx = $tBuXm->getTrimString('filename'); goto Yr3DO; Xqf4k: $t68n7 = ModelUtil::get('pic_uploader_member', array('uploadToken' => $ufeje)); goto i4XxZ; GOPSs: ModelUtil::insert('pic_uploader_item', array('memberUserId' => $t68n7['id'], 'dataId' => $cwaKT['id'])); goto gTG4H; Yr3DO: $V0Dls = $tBuXm->getBase64Image('content'); goto Fsh3f; UkfZy: if (!PicUploaderUtil::uploadPermit($t68n7['id'])) { return Response::generateError('不允许上传'); } goto TYXB6; ANHxd: $cwaKT = $ZrjxR['data']['data']; goto GOPSs; rzI7P: $ZrjxR = DataManager::upload('image', $v3nkx, $V0Dls); goto qSYJ4; SKLET: } }