From 2e53366717ad57da1a9dd6dc71a69c078961ad74 Mon Sep 17 00:00:00 2001
From: colly_wyx <wangyixiong_007@163.com>
Date: Thu, 10 Aug 2017 17:21:37 +0800
Subject: [PATCH] 新闻模块,平台首页
---
application/modules/Public/controllers/User.php | 71 +++++++++++++++++++++++++++++++++--
1 files changed, 66 insertions(+), 5 deletions(-)
diff --git a/application/modules/Public/controllers/User.php b/application/modules/Public/controllers/User.php
index ba411de..aca388a 100644
--- a/application/modules/Public/controllers/User.php
+++ b/application/modules/Public/controllers/User.php
@@ -5,7 +5,7 @@
class UserController extends System_Controller_Web{
public function init(){
- $this->request = $this->getRequest();
+ $this->request = $this->getRequest();
if($this->request->action == "login"){
$this->setLayout();
}
@@ -28,10 +28,7 @@
else{
exit($this->showSuccess('������������', true));
}
- }
- else{
- $this->setLayout();
- }
+ }
}
/**
@@ -43,6 +40,70 @@
$this->redirect('/user_login.html');
}
+ /**
+ * ������
+ */
+ public function UploadAction(){
+ //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/Shanghai");
+ error_reporting(E_ERROR);
+ header("Content-Type: text/html; charset=utf-8");
+
+ $CONFIG = json_decode(preg_replace("/\/\*[\s\S]+?\*\//", "", file_get_contents("themes/ueditor/php/config.json")), true);
+ $action = $this->get('action');
+ switch ($action) {
+ case 'config':
+ $result = json_encode($CONFIG);
+ break;
+
+ /* ������������ */
+ case 'uploadimage':
+ /* ������������ */
+ case 'uploadscrawl':
+ /* ������������ */
+ case 'uploadvideo':
+ /* ������������ */
+ case 'uploadfile':
+ $result = include("themes/ueditor/php/action_upload.php");
+ break;
+
+ /* ������������ */
+ case 'listimage':
+ $result = include("themes/ueditor/php/action_list.php");
+ break;
+ /* ������������ */
+ case 'listfile':
+ $result = include("themes/ueditor/php/action_list.php");
+ break;
+
+ /* ������������������ */
+ case 'catchimage':
+ $result = include("themes/ueditor/php/action_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;
+ }
+ die();
+ }
+
}
--
Gitblit v1.8.0