1 Star 3 Fork 1

gmg137 / UEditor-SCS-plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
controller.php 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
gmg137 提交于 2014-09-06 15:07 . Update README.md
<?php
//header('Access-Control-Allow-Origin: http://www.baidu.com'); //设置http://www.baidu.com允许跨域访问
//header('Access-Control-Allow-Headers: X-Requested-With,X_Requested_With'); //设置允许的跨域header
date_default_timezone_set("Asia/chongqing");
error_reporting(E_ERROR);
header("Content-Type: text/html; charset=utf-8");
include_once('conf.php'); //引入SCS配置文件
if($openscs){
$type = "scs";
$json = "scs_";
}else{
$type = "action";
$json = "";
}
$CONFIG = json_decode(preg_replace("/\/\*[\s\S]+?\*\//", "", file_get_contents($json."config.json")), true);
$action = $_GET['action'];
switch ($action) {
case 'config':
$result = json_encode($CONFIG);
break;
/* 上传图片 */
case 'uploadimage':
/* 上传涂鸦 */
case 'uploadscrawl':
/* 上传视频 */
case 'uploadvideo':
/* 上传文件 */
case 'uploadfile':
$result = include($type."_upload.php");
break;
/* 列出图片 */
case 'listimage':
$result = include($type."_list.php");
break;
/* 列出文件 */
case 'listfile':
$result = include($type."_list.php");
break;
/* 抓取远程文件 */
case 'catchimage':
$result = include($type."_crawler.php");
break;
default:
$result = json_encode(array(
'state'=> '请求地址出错'
));
break;
}
/* 输出结果 */
if (isset($_GET["callback"])) {
if (preg_match("/^[\w_]+$/", $_GET["callback"])) {
echo htmlspecialchars($_GET["callback"]) . '(' . $result . ')';
} else {
echo json_encode(array(
'state'=> 'callback参数不合法'
));
}
} else {
echo $result;
}
PHP
1
https://gitee.com/gmg137/UEditor-SCS-plugin.git
git@gitee.com:gmg137/UEditor-SCS-plugin.git
gmg137
UEditor-SCS-plugin
UEditor-SCS-plugin
master

搜索帮助