Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemon committed Feb 19, 2021
1 parent 2b95f59 commit 4fdae50
Show file tree
Hide file tree
Showing 705 changed files with 161,994 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.svn
1 change: 1 addition & 0 deletions 1/admin/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
对不起,您访问的页面不存在
17 changes: 17 additions & 0 deletions 1/admin/Config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

// cookie中使用的hostname
define('HOST_NAME', ROOT_DOMAIN);

define('GATEWAY_URL_ROOT', 'http://developapi.applinzi.com/');

define('APP_KEY', 'j31xol234l');
define('APP_SECRET', '130x3wwl1x3xklyii5wmy1ilmi5xyzlkzxx43ji4');

define('APP_TOKEN', '90op78kl56nm34ui12hj');

define('USER_AUTO_LOGIN', 0);

define('REQUEST_TIMERANGE', 300);

define('API_REQUEST_TIMEOUT', 5);
19 changes: 19 additions & 0 deletions 1/admin/Globals.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
// session的超时时间
define('SESSION_EXPIRE_TIME', 0);

// 失效时间30天
define('SESSION_MAX_TIME', 2592000);

// SESSION ID
define('SESSIONID', 'SESSIONID');

define('U_UID', 'U_UID');

define('UID', 'uid');

define('COOKIE_EXPIRE_TIME', 0);

define('LOG_CONF_FILE', WEB_ROOT . 'log4php.properties');

define('STATUS_SUCCESS', 200);
115 changes: 115 additions & 0 deletions 1/admin/common/Enums.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?php

abstract class RouterConfig {
const INDEX = '/';
const USER_MOBILE_CHECK = '/account/mobileCheck';
const ADD_USER = '/account/addUser';
const USER_LOGIN = '/account/login';
const USER_LOGOUT = '/account/logout';
const USER_INFO = '/account/userInfo';
const USER_LIST = '/account/userList';
const SET_USER_STATUS = '/account/setUserStatus';
const SET_USER_INFO = '/account/setUserInfo';
const USER_RESET_PASSWORD = '/account/resetPassword';
const USER_MEMU = '/account/userMenu';
const STORY_BASE = '/story/storyBaseInfo';
const STORY_BASE_SET = '/story/storyBaseInfoSet';
const SONG_BASE = '/song/songBaseInfo';
const SONG_BASE_SET = '/song/songBaseInfoSet';
const WORD_CATEGORY = '/word/category';
const WORD_CATEGORY_SET = '/word/categorySet';
const WORD_BASE = '/word/wordBaseInfo';
const WORD_BASE_SET = '/word/wordBaseInfoSet';
const COURSE_BASE = '/course/courseBaseInfo';
const COURSE_BASE_SET = '/course/courseBaseInfoSet';
const ACTIVITY_BASE = '/activity/activityBaseInfo';
const ACTIVITY_BASE_SET = 'activity/activityBaseInfoSet';
const UPLOAD_PIC = '/general/uploadpicture';
const UPLOAD_FILE = '/general/uploadfile';
const DOWNLOAD_FILE = '/general/downloadfile';
const APP_BASE = '/app/appBaseInfo';
const CONTENT_BASE = '/content/contentBaseInfo';
const AUTH_MENU = '/auth/menu';
const AUTH_ACTION = '/auth/action';
const AUTH_USER_GROUP = '/auth/usergroup';
const USER_SEND_SMS = '/general/sendSMS';
const USER_VERIFY_SMS = '/general/verifySMS';
}

abstract class RouterMap {
public static $router = array(
RouterConfig::INDEX => 'IndexController',
RouterConfig::USER_MOBILE_CHECK => 'account/mobileCheckController',
RouterConfig::ADD_USER => 'account/addUserController',
RouterConfig::USER_LOGIN => 'account/LoginController',
RouterConfig::USER_LOGOUT => 'account/LogoutController',
RouterConfig::USER_INFO => 'account/userInfoController',
RouterConfig::USER_LIST => 'account/userListController',
RouterConfig::SET_USER_STATUS => 'account/setUserStatusController',
RouterConfig::SET_USER_INFO => 'account/setUserInfoController',
RouterConfig::USER_RESET_PASSWORD => 'account/resetPasswordController',
RouterConfig::USER_MEMU => 'account/userMenuController',
RouterConfig::STORY_BASE => 'story/storyBaseInfoController',
RouterConfig::STORY_BASE_SET => 'story/storyBaseInfoSetController',
RouterConfig::SONG_BASE => 'song/songBaseInfoController',
RouterConfig::SONG_BASE_SET => 'song/songBaseInfoSetController',
RouterConfig::WORD_CATEGORY => 'word/wordCategoryController',
RouterConfig::WORD_CATEGORY_SET => 'word/wordCategorySetController',
RouterConfig::WORD_BASE => 'word/wordBaseInfoController',
RouterConfig::WORD_BASE_SET => 'word/wordBaseInfoSetController',
RouterConfig::COURSE_BASE => 'course/courseBaseInfoController',
RouterConfig::COURSE_BASE_SET => 'course/courseBaseInfoSetController',
RouterConfig::ACTIVITY_BASE => 'activity/activityBaseInfoController',
RouterConfig::ACTIVITY_BASE_SET => 'activity/activityBaseInfoSetController',
RouterConfig::UPLOAD_PIC => 'general/UploadPictureController',
RouterConfig::UPLOAD_FILE => 'general/UploadFileController',
RouterConfig::DOWNLOAD_FILE => 'general/DownloadFileController',
RouterConfig::APP_BASE => 'app/appBaseInfoController',
RouterConfig::CONTENT_BASE => 'content/contentBaseInfoController',
RouterConfig::AUTH_MENU => 'auth/menuController',
RouterConfig::AUTH_ACTION => 'auth/actionController',
RouterConfig::AUTH_USER_GROUP => 'auth/usergroupController',
RouterConfig::USER_SEND_SMS => 'general/sendSMSController',
RouterConfig::USER_VERIFY_SMS => 'general/verifySMSController'
);
}

abstract class APIConfig {
const USER_MOBILE_CHECK = 'account/admin/v1/mobileCheck';
const ADD_USER = 'account/admin/v1/addUser';
const USER_LOGIN = 'account/admin/v1/login';
const USER_INFO = 'account/admin/v1/userInfo';
const USER_LIST = 'account/admin/v1/userList';
const SET_USER_STATUS = 'account/admin/v1/setUserStatus';
const SET_USER_INFO = 'account/admin/v1/setUserInfo';
const USER_RESET_PASSWORD = 'account/admin/v1/resetPassword';
const USER_MEMU = 'account/admin/v1/userMenu';
const STORY_BASE = 'story/v1/baseinfo';
const STORY_BASE_SET = 'story/v1/baseinfoSet';
const SONG_BASE = 'song/v1/baseinfo';
const SONG_BASE_SET = 'song/v1/baseinfoSet';
const WORD_CATEGORY = 'word/v1/category';
const WORD_CATEGORY_SET = 'word/v1/categorySet';
const WORD_BASE = 'word/v1/baseinfo';
const WORD_BASE_SET = 'word/v1/baseinfoSet';
const COURSE_BASE = 'course/v1/baseinfo';
const COURSE_BASE_SET = 'course/v1/baseinfoSet';
const ACTIVITY_BASE = 'activity/v1/baseinfo';
const ACTIVITY_BASE_SET = 'activity/v1/baseinfoSet';
const UPLOAD_PIC = 'general/uploadpicture';
const UPLOAD_FILE = 'general/uploadfile';
const DOWNLOAD_FILE = 'general/downloadfile';
const APP_BASE = 'app/baseinfo';
const CONTENT_BASE = 'content/baseinfo';
const AUTH_MENU = 'auth/menu';
const AUTH_ACTION = 'auth/action';
const AUTH_USER_GROUP = 'auth/usergroup';
const USER_SEND_SMS = 'general/sendSMS';
const USER_VERIFY_SMS = 'general/verifySMS';
}

abstract class APIMap {
public static function getAPI ($name) {
return GATEWAY_URL_ROOT . $name;
}
}
18 changes: 18 additions & 0 deletions 1/admin/common/InitCookieAndSession.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
require(PHP_ROOT . 'libs/util/Utility.php');

Session::Init();

// 初始化Cookie SESSIONID
$session_id = Cookie::Get(SESSIONID);
if (empty($session_id)) {
$session_id = session_id();
Cookie::Set(SESSIONID, $session_id);
}

// 全站唯一标识
$u_uid = Cookie::Get(U_UID);
if (empty($u_uid)) {
$u_uid = $session_id;
Cookie::Set(U_UID, $u_uid, time() + 86400 * 180);
}
17 changes: 17 additions & 0 deletions 1/admin/common/InitRootDomain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/**
* 多域名支持,初始化当前根域名
*/
$_root_domains = array('fangxiangadmin.applinzi.com', 'admin.directionedu.com');
foreach ($_root_domains as $_root_domain) {
if (stripos($_SERVER['HTTP_HOST'], $_root_domain)) {
define('ROOT_DOMAIN', $_root_domain);
break;
}
}

// 开发环境指定一个root domain
if (!defined('ROOT_DOMAIN')) {
define('ROOT_DOMAIN', $_root_domains[0]);
}
16 changes: 16 additions & 0 deletions 1/admin/common/InitRouter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
require(PHP_ROOT . 'libs/mvc/UrlRouter.php');

class CustomUrlRouter extends UrlRouter {

protected function GetNotFoundController () {
return 'NotFoundController';
}
}

$url_router = new CustomUrlRouter();
$router_list = RouterMap::$router;
$url_router->SetMapping($router_list);

$url_router->SetControllerPath(WEB_ROOT . 'controllers');
$url_router->Route();
14 changes: 14 additions & 0 deletions 1/admin/common/InitSmarty.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
require(PHP_ROOT . 'libs/util/SmartyHelper.php');

// smarty 配置
$g_smarty_conf = array(
'tpl_path' => WEB_ROOT . '/smarty/template/',
'tpc_path' => 'saemc://template_c/',
'sconf_path' => WEB_ROOT . '/smarty/config/',
'scache_path' => 'saemc://cache/',
'splugin_path' => WEB_ROOT . '/smarty/plugin'
);

// 初始化Smarty
SmartyHelper::SetSmartyConfig($g_smarty_conf);
11 changes: 11 additions & 0 deletions 1/admin/common/utility/CheckLogin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

class CheckLogin {
public static function isLogin () {
$uid = $_COOKIE['uid'];
if (empty($uid) || !Utility::CheckSessionValid($uid)) {
return false;
}
return true;
}
}
12 changes: 12 additions & 0 deletions 1/admin/common/utility/log/SaeLog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

class SaeLog {
public static function writelog_debug ($msg) {
sae_set_display_errors(false);//关闭信息输出
if (is_array($msg)) {
$msg = implode(",", $msg);
}
sae_debug("[eduApp]".$msg);//记录日志
sae_set_display_errors(true);//记录日志后再打开信息输出,否则会阻止正常的错误信息的显示
}
}
13 changes: 13 additions & 0 deletions 1/admin/controllers/IndexController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebPageController.php');
require(WEB_ROOT . 'models/IndexModel.php');

class IndexController extends WebPageController {

protected $template_ = 'B/page/index.tpl';

protected function GetResponse_() {
$model = new IndexModel();
return $model->GetResponse();
}
}
13 changes: 13 additions & 0 deletions 1/admin/controllers/NotFoundController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebPageController.php');
require(WEB_ROOT . 'models/NotFoundModel.php');

class NotFoundController extends WebPageController {

protected $template_ = WEB_ROOT . '404.html';

protected function GetResponse_() {
$model = new NotFoundModel();
return $model->GetResponse();
}
}
11 changes: 11 additions & 0 deletions 1/admin/controllers/account/LoginController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebAjaxController.php');
require(WEB_ROOT . 'models/account/LoginModel.php');

class LoginController extends WebAjaxController {

protected function GetResponse_ () {
$model = new LoginModel();
return $model->GetResponse();
}
}
11 changes: 11 additions & 0 deletions 1/admin/controllers/account/LogoutController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebAjaxController.php');
require(WEB_ROOT . 'models/account/LogoutModel.php');

class LogoutController extends WebAjaxController {

protected function GetResponse_ () {
$model = new LogoutModel();
return $model->GetResponse();
}
}
11 changes: 11 additions & 0 deletions 1/admin/controllers/account/addUserController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebAjaxController.php');
require(WEB_ROOT . 'models/account/addUserModel.php');

class addUserController extends WebAjaxController {

protected function GetResponse_ () {
$model = new addUserModel();
return $model->GetResponse();
}
}
11 changes: 11 additions & 0 deletions 1/admin/controllers/account/mobileCheckController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebAjaxController.php');
require(WEB_ROOT . 'models/account/mobileCheckModel.php');

class mobileCheckController extends WebAjaxController {

protected function GetResponse_ () {
$model = new mobileCheckModel();
return $model->GetResponse();
}
}
11 changes: 11 additions & 0 deletions 1/admin/controllers/account/resetPasswordController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebAjaxController.php');
require(WEB_ROOT . 'models/account/resetPasswordModel.php');

class resetPasswordController extends WebAjaxController {

protected function GetResponse_ () {
$model = new resetPasswordModel();
return $model->GetResponse();
}
}
11 changes: 11 additions & 0 deletions 1/admin/controllers/account/setUserInfoController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebAjaxController.php');
require(WEB_ROOT . 'models/account/setUserInfoModel.php');

class setUserInfoController extends WebAjaxController {

protected function GetResponse_ () {
$model = new setUserInfoModel();
return $model->GetResponse();
}
}
11 changes: 11 additions & 0 deletions 1/admin/controllers/account/setUserStatusController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebAjaxController.php');
require(WEB_ROOT . 'models/account/setUserStatusModel.php');

class setUserStatusController extends WebAjaxController {

protected function GetResponse_ () {
$model = new setUserStatusModel();
return $model->GetResponse();
}
}
11 changes: 11 additions & 0 deletions 1/admin/controllers/account/userInfoController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebAjaxController.php');
require(WEB_ROOT . 'models/account/userInfoModel.php');

class userInfoController extends WebAjaxController {

protected function GetResponse_ () {
$model = new userInfoModel();
return $model->GetResponse();
}
}
11 changes: 11 additions & 0 deletions 1/admin/controllers/account/userListController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebAjaxController.php');
require(WEB_ROOT . 'models/account/userListModel.php');

class userListController extends WebAjaxController {

protected function GetResponse_ () {
$model = new userListModel();
return $model->GetResponse();
}
}
11 changes: 11 additions & 0 deletions 1/admin/controllers/account/userMenuController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
require(WEB_ROOT . 'controllers/extra/WebAjaxController.php');
require(WEB_ROOT . 'models/account/userMenuModel.php');

class userMenuController extends WebAjaxController {

protected function GetResponse_ () {
$model = new userMenuModel();
return $model->GetResponse();
}
}
Loading

0 comments on commit 4fdae50

Please sign in to comment.