<?php
 namespace Module\ConfigSite\Api\Controller; use Illuminate\Routing\Controller; use ModStart\Core\Assets\AssetsUtil; use ModStart\Core\Input\Response; use ModStart\Core\Util\FileUtil; class ConfigController extends Controller { public function index() { $data = []; $config = modstart_config(); $data['siteLogo'] = AssetsUtil::fixFull($config->get('siteLogo')); $data['siteName'] = $config->get('siteName'); $data['siteSlogan'] = $config->get('siteSlogan'); $data['siteDomain'] = $config->get('siteDomain'); $data['siteKeywords'] = $config->get('siteKeywords'); $data['siteDescription'] = $config->get('siteDescription'); $data['siteFavIco'] = AssetsUtil::fixFull($config->get('siteFavIco')); $data['siteBeian'] = $config->get('siteBeian'); $data['loginCaptchaEnable'] = $config->getBoolean('loginCaptchaEnable'); $data['registerDisable'] = $config->getBoolean('registerDisable'); $data['registerEmailEnable'] = $config->getBoolean('registerEmailEnable'); $data['registerPhoneEnable'] = $config->getBoolean('registerPhoneEnable'); $data['retrieveDisable'] = $config->getBoolean('retrieveDisable'); $data['retrievePhoneEnable'] = $config->getBoolean('retrievePhoneEnable'); $data['retrieveEmailEnable'] = $config->getBoolean('retrieveEmailEnable'); $data['ssoClientEnable'] = $config->getBoolean('ssoClientEnable', false); $data['dataUpload'] = []; $data['dataUpload'] = [ 'chunkSize' => max(FileUtil::formattedSizeToBytes(ini_get('upload_max_filesize')) - 500 * 1024, 1024), 'category' => [], ]; $uploads = config('data.upload'); foreach ($uploads as $category => $categoryInfo) { $data['dataUpload']['category'][$category] = [ 'maxSize' => $categoryInfo['maxSize'], 'extensions' => $categoryInfo['extensions'], ]; } return Response::jsonSuccessData($data); } }