<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\PicUploader\Web\Controller; use ModStart\App\Web\Layout\WebConfigBuilder; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Input\Request; use ModStart\Core\Input\Response; use ModStart\Core\Util\ArrayUtil; use ModStart\Core\Util\RandomUtil; use ModStart\Form\Form; use Module\Member\Auth\MemberUser; use Module\Member\Web\Controller\MemberFrameController; class MemberApiController extends MemberFrameController { public function index(WebConfigBuilder $enw1u) { goto yTITU; yTITU: $rpy90 = ModelUtil::get('pic_uploader_member', MemberUser::id()); goto PwHXQ; qa6WB: $enw1u->formClass('wide'); goto v7jkn; O_djR: $enw1u->page()->view($this->viewMemberFrame); goto JbW9j; KHNUJ: $enw1u->pageTitle('接口设置'); goto O_djR; BAcL2: $enw1u->display('uploadToken', 'UploadToken')->addable(true)->help('上传链接 ' . Request::domainUrl() . modstart_web_url('pic_uploader/token/' . $rpy90['uploadToken'])); goto qa6WB; v7jkn: return $enw1u->perform($rpy90, function (Form $hUMbi) { $cwaKT = $hUMbi->dataForming(); $cwaKT = ArrayUtil::keepKeys($cwaKT, array('uploadTokenEnable')); ModelUtil::update('pic_uploader_member', MemberUser::id(), $cwaKT); return Response::generateSuccess('保存成功'); }); goto F0l_z; PwHXQ: if (empty($rpy90)) { $rpy90 = ModelUtil::insert('pic_uploader_member', array('id' => MemberUser::id(), 'uploadTokenEnable' => false, 'uploadToken' => RandomUtil::lowerString(32))); } goto KHNUJ; JbW9j: $enw1u->switch('uploadTokenEnable', '开启接口上传')->optionsYesNo(); goto BAcL2; F0l_z: } }