This action will force synchronization from ApiAdmin/ApiAdmin, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
<?php// +----------------------------------------------------------------------// | ThinkPHP [ WE CAN DO IT JUST THINK ]// +----------------------------------------------------------------------// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.// +----------------------------------------------------------------------// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )// +----------------------------------------------------------------------// | Author: 流年 <liu21st@gmail.com>// +----------------------------------------------------------------------/*** 判断是否是系统管理员* @param mixed $uid* @return bool*/function isAdministrator( $uid = '' ){$adminConf = config('base')['USER_ADMINISTRATOR'];$uid = empty($uid) ? session('uid') : $uid;if( is_array($adminConf) ){if( is_array( $uid ) ){$m = array_intersect( $adminConf, $uid );if( count($m) ){return TRUE;}}else{if( in_array( $uid, $adminConf ) ){return TRUE;}}}else{if( is_array( $uid ) ){if( in_array($adminConf,$uid) ){return TRUE;}}else{if( $uid == $adminConf){return TRUE;}}}return FALSE;}/*** CURL post数据* @param $url* @param $data* @param array $urlParam* @param array $header* @return mixed*/function curlPost( $url, $data, $urlParam = [], $header = [] ){$ch = curl_init();if( !empty($urlParam) ){$url = $url.'?'.http_build_query($urlParam);}curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, $data);if( !empty($header) ){$headerStrArr = [];foreach ($header as $key => $value){$headerStrArr[] = "$key: $value";}curl_setopt($ch, CURLOPT_HTTPHEADER, $headerStrArr);}curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_URL, $url);$return = curl_exec($ch);curl_close($ch);return $return;}/*** 把返回的数据集转换成Tree* @param $list* @param string $pk* @param string $pid* @param string $child* @param string $root* @return array*/function listToTree($list, $pk='id', $pid = 'fid', $child = '_child', $root = '0') {$tree = [];if(is_array($list)) {$refer = [];foreach ($list as $key => $data) {$refer[$data[$pk]] = &$list[$key];}foreach ($list as $key => $data) {$parentId = $data[$pid];if ($root == $parentId) {$tree[] = &$list[$key];}else{if (isset($refer[$parentId])) {$parent = &$refer[$parentId];$parent[$child][] = &$list[$key];}}}}return $tree;}function formatTree($list, $lv = 0, $title = 'name'){$formatTree = [];foreach($list as $key => $val){$title_prefix = '';for( $i=0;$i<$lv;$i++ ){$title_prefix .= "|---";}$val['lv'] = $lv;$val['namePrefix'] = $lv == 0 ? '' : $title_prefix;$val['showName'] = $lv == 0 ? $val[$title] : $title_prefix.$val[$title];if(!array_key_exists('_child', $val)){array_push($formatTree, $val);}else{$child = $val['_child'];unset($val['_child']);array_push($formatTree, $val);$middle = formatTree($child, $lv+1, $title); //进行下一层递归$formatTree = array_merge($formatTree, $middle);}}return $formatTree;}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。