diff --git a/App/Config.php b/App/Config.php index 3d9cf42..12f5105 100644 --- a/App/Config.php +++ b/App/Config.php @@ -24,12 +24,19 @@ class Config * Database user * @var string */ - const DB_USER = 'caiyu'; + // const DB_USER = 'caiyu'; + // /** + // * Database password + // * @var string + // */ + // const DB_PASSWORD = 'zhengcaiyu123'; + + const DB_USER = 'background'; /** * Database password * @var string */ - const DB_PASSWORD = 'zhengcaiyu123'; + const DB_PASSWORD = 'a7458969'; /** * Show or hide error messages on screen * @var boolean @@ -60,9 +67,13 @@ class Config if("testingcloud.club" == $_SERVER['SERVER_NAME']){ return "https://www.testingcloud.club/wapi/"; } + if("phpmyadmin" == $_SERVER['SERVER_NAME']){ + return "https://sub1.testingcloud.club/wapi/"; + } if("" == $_SERVER['SERVER_NAME']){ return "https://www.testingcloud.club/wapi/"; } + var_dump("server name is ",$_SERVER['SERVER_NAME']); } static public function OpenApiUrl() { if ( "0.0.0.0" == $_SERVER['SERVER_NAME']){ @@ -71,6 +82,9 @@ class Config if("testingcloud.club" == $_SERVER['SERVER_NAME']){ return "https://www.testingcloud.club/sapi/"; } + if("phpmyadmin" == $_SERVER['SERVER_NAME']){ + return "https://sub1.testingcloud.club/sapi/"; + } return "https://www.testingcloud.club/sapi/"; } diff --git a/App/Controllers/ArticleTree.php b/App/Controllers/ArticleTree.php index 3450cc5..0171a14 100644 --- a/App/Controllers/ArticleTree.php +++ b/App/Controllers/ArticleTree.php @@ -181,6 +181,7 @@ class ArticleTree extends Controller ]); } else{ + // print_r($this->params); View::renderTemplate("/blog/article.html",[ "url"=>\App\Config::ServerUrl(), 'route'=>'article', @@ -189,7 +190,7 @@ class ArticleTree extends Controller "alltitle" => $titles, "groups" => $groups, "group_types"=>$groupstype, - "title"=>urldecode ($this->params[1]), + // "title"=>urldecode ($this->params[1]), "doc"=>$doc[0], "docs"=>$doc, "comments" => $doccoment, @@ -245,6 +246,7 @@ class ArticleTree extends Controller ]); else + print_r($top5); View::renderTemplate("/blog/article.html", [ "url"=>\App\Config::ServerUrl(), 'route'=>'article', diff --git a/App/Views/blog/article.html b/App/Views/blog/article.html index b6ef18e..cdbeb10 100644 --- a/App/Views/blog/article.html +++ b/App/Views/blog/article.html @@ -410,12 +410,14 @@ function expandNode(e) { if(domain === '127.0.0.1'){ console.log("debug mode"); }else{ - console.log(baseUrl); baseUrl = "https://www.testingcloud.club/wapi/"; } if(domain == "192.168.3.100"){ baseUrl = 'http://192.168.3.100/api/public/'; } + if(domain == "sub1.testingcloud.club"){ + baseUrl = 'http://sub1.testingcloud.club/api/public/'; + } $('#editable-select').editableSelect({ effects: 'slide', appendTo: '#search', @@ -457,13 +459,14 @@ function expandNode(e) { baseUrl = 'http://127.0.0.1/api/public/'; console.log("debug mode"); }else{ - console.log(baseUrl); baseUrl = "https://www.testingcloud.club/wapi/"; } if(domain == "192.168.3.100"){ - console.log(baseUrl); baseUrl = 'http://192.168.3.100/api/public/'; } + if(domain == "sub1.testingcloud.club"){ + baseUrl = 'http://sub1.testingcloud.club/api/public/'; + } var keyword = document.getElementById("term").value; if (keyword == "") { clearContent(); diff --git a/App/Views/blog/index.html b/App/Views/blog/index.html index d3466ef..861dbad 100644 --- a/App/Views/blog/index.html +++ b/App/Views/blog/index.html @@ -178,6 +178,9 @@ if(domain == "192.168.3.100"){ baseUrl = 'http://192.168.3.100/api/public/'; } + if(domain == "sub1.testingcloud.club"){ + baseUrl = 'http://sub1.testingcloud.club/api/public/'; + } $('#editable-select').editableSelect({ effects: 'slide', appendTo: '#search', @@ -223,13 +226,16 @@ baseUrl = 'http://127.0.0.1/api/public/'; console.log("debug mode"); }else{ - console.log(baseUrl); baseUrl = "https://www.testingcloud.club/wapi/"; } if(domain == "192.168.3.100"){ - console.log(baseUrl); baseUrl = 'http://192.168.3.100/api/public/'; } + if(domain == "sub1.testingcloud.club"){ + console.log(baseUrl); + baseUrl = 'http://sub1.testingcloud.club/wapi/'; + } + var keyword = document.getElementById("term").value; if (keyword == "") { clearContent(); diff --git a/App/Views/blog/js/scripts.js b/App/Views/blog/js/scripts.js index cdff305..9fdeb66 100644 --- a/App/Views/blog/js/scripts.js +++ b/App/Views/blog/js/scripts.js @@ -47,12 +47,14 @@ $(document).ready( if(domain === '127.0.0.1'){ console.log("debug mode"); }else{ - console.log(baseUrl); baseUrl = "https://www.testingcloud.club/wapi/"; } if(domain == "192.168.3.100"){ var baseUrl = 'http://192.168.3.100/api/public/'; } + if(domain == "sub1.testingcloud.club"){ + baseUrl = 'http://sub1.testingcloud.club/api/public/'; + } $.ajax({ method: "POST", url: baseUrl + "Doc/count", diff --git a/App/Views/blog/template/about.html b/App/Views/blog/template/about.html index 66cb824..bc6f530 100644 --- a/App/Views/blog/template/about.html +++ b/App/Views/blog/template/about.html @@ -15,7 +15,7 @@

耕耘领域:

服务端开发

嵌入式开发

-

git

> +

git

> {% endblock %} diff --git a/App/Views/blog/template/article.html b/App/Views/blog/template/article.html index ab3fe4f..ad42035 100644 --- a/App/Views/blog/template/article.html +++ b/App/Views/blog/template/article.html @@ -11,7 +11,7 @@