fixed
This commit is contained in:
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -11,6 +11,37 @@
|
||||
// +----------------------------------------------------------------------
|
||||
use think\Env;
|
||||
|
||||
//定位到项目根目录 E:\wsh\projects\boom_imx
|
||||
$root_path = str_replace('config','',__DIR__);
|
||||
|
||||
|
||||
list($debug,$trace,$sys_env) = [false,false,'DEV'];
|
||||
|
||||
|
||||
if (!function_exists('auto_choose_app_conf')) {
|
||||
function auto_choose_app_conf(&$debug,&$trace,&$sys_env){
|
||||
$domain = $_SERVER['HTTP_HOST']; //获取当前域名 (含端口号)
|
||||
if(in_array($domain, ['xxx.playone.cn'])){
|
||||
//正式 - 全域名
|
||||
$debug = true;
|
||||
$trace = false;
|
||||
$sys_env = 'PROD';
|
||||
}
|
||||
//测试
|
||||
else if(in_array($domain, ['xxxxx.playone.cn','xxx.com'])) {
|
||||
$debug = true;
|
||||
$trace = false;
|
||||
$sys_env = 'DEV';
|
||||
}
|
||||
else {
|
||||
//本地
|
||||
$debug = true;
|
||||
$trace = false;
|
||||
$sys_env = 'LOCAL';
|
||||
}
|
||||
}
|
||||
}
|
||||
auto_choose_app_conf($debug,$trace,$sys_env);
|
||||
return [
|
||||
// +----------------------------------------------------------------------
|
||||
// | 应用设置
|
||||
@@ -18,9 +49,9 @@ return [
|
||||
// 应用命名空间
|
||||
'app_namespace' => 'app',
|
||||
// 应用调试模式
|
||||
'app_debug' => Env::get('app.debug', false),
|
||||
'app_debug' => $debug,
|
||||
// 应用Trace
|
||||
'app_trace' => Env::get('app.trace', false),
|
||||
'app_trace' => $trace,
|
||||
// 应用模式状态
|
||||
'app_status' => '',
|
||||
// 是否支持多模块
|
||||
@@ -259,7 +290,7 @@ return [
|
||||
// 驱动方式
|
||||
'type' => 'Mysql',
|
||||
// 缓存前缀
|
||||
'key' => 'i3d6o32wo8fvs1fvdpwens',
|
||||
'key' => 'roST1cg0hXEnMWmVtlKa4NFv6fPk9DQb',
|
||||
// 加密方式
|
||||
'hashalgo' => 'ripemd160',
|
||||
// 缓存有效期 0表示永久缓存
|
||||
|
||||
@@ -12,19 +12,55 @@
|
||||
|
||||
use think\Env;
|
||||
|
||||
list($hostname,$database,$username,$password,$hostport) = ['','','','',''];
|
||||
|
||||
if (!function_exists('auto_choose_db_conf')) {
|
||||
function auto_choose_db_conf(&$hostname,&$database,&$username,&$password,&$hostport){
|
||||
$domain = $_SERVER['HTTP_HOST']; //获取当前域名 (含端口号)
|
||||
//正式
|
||||
if(in_array($domain, [
|
||||
'sdsdsd.sss.cn'
|
||||
])){
|
||||
$hostname = 'localhost';
|
||||
$database = 'dddd';
|
||||
$username = 'dddd';
|
||||
$password = 'ffff';
|
||||
$hostport = '3306';
|
||||
}
|
||||
|
||||
//测试 socket请求这里$domain=null,【上线正式环境之后把null移动到正式环境配置】
|
||||
else if(in_array($domain, [null,'sdsd.playone.cn','sdsd.zcc10.com'])) {
|
||||
$hostname = 'localhost';
|
||||
$database = 'ssss';
|
||||
$username = 'sssss';
|
||||
$password = 'ssssss';
|
||||
$hostport = '3306';
|
||||
}
|
||||
|
||||
//本地
|
||||
else{
|
||||
$hostname = '127.0.0.1';
|
||||
$database = 'digital_doctor';
|
||||
$username = 'root';
|
||||
$password = 'root';//root or 123456
|
||||
$hostport = '3306';
|
||||
}
|
||||
}
|
||||
}
|
||||
auto_choose_db_conf($hostname,$database,$username,$password,$hostport);
|
||||
return [
|
||||
// 数据库类型
|
||||
'type' => Env::get('database.type', 'mysql'),
|
||||
'type' => 'mysql',
|
||||
// 服务器地址
|
||||
'hostname' => Env::get('database.hostname', '127.0.0.1'),
|
||||
'hostname' => $hostname,
|
||||
// 数据库名
|
||||
'database' => Env::get('database.database', 'fastadmin'),
|
||||
'database' => $database,
|
||||
// 用户名
|
||||
'username' => Env::get('database.username', 'root'),
|
||||
// 密码
|
||||
'password' => Env::get('database.password', ''),
|
||||
'username' => $username,//正式:root,测试:zc_game_admin,本地root
|
||||
// 密码.
|
||||
'password' => $password,//正式:hbDB8SRa3Ix3poVi,测试:KZK4cGd4XYsbNG5w,本地root
|
||||
// 端口
|
||||
'hostport' => Env::get('database.hostport', ''),
|
||||
'hostport' => $hostport,
|
||||
// 连接dsn
|
||||
'dsn' => '',
|
||||
// 数据库连接参数
|
||||
|
||||
@@ -1,40 +1,44 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => '我的网站',
|
||||
'beian' => '',
|
||||
'cdnurl' => '',
|
||||
'version' => '1.0.1',
|
||||
'timezone' => 'Asia/Shanghai',
|
||||
'forbiddenip' => '',
|
||||
'languages' => [
|
||||
'backend' => 'zh-cn',
|
||||
'frontend' => 'zh-cn',
|
||||
],
|
||||
'fixedpage' => 'dashboard',
|
||||
'categorytype' => [
|
||||
'default' => 'Default',
|
||||
'page' => 'Page',
|
||||
'article' => 'Article',
|
||||
'test' => 'Test',
|
||||
],
|
||||
'configgroup' => [
|
||||
'basic' => 'Basic',
|
||||
'email' => 'Email',
|
||||
'dictionary' => 'Dictionary',
|
||||
'user' => 'User',
|
||||
'example' => 'Example',
|
||||
],
|
||||
'attachmentcategory' => [
|
||||
'category1' => 'Category1',
|
||||
'category2' => 'Category2',
|
||||
'custom' => 'Custom',
|
||||
],
|
||||
'mail_type' => '1',
|
||||
'mail_smtp_host' => 'smtp.qq.com',
|
||||
'mail_smtp_port' => '465',
|
||||
'mail_smtp_user' => '',
|
||||
'mail_smtp_pass' => '',
|
||||
'mail_verify_type' => '2',
|
||||
'mail_from' => '',
|
||||
];
|
||||
return array (
|
||||
'name' => '数智人医生',
|
||||
'beian' => '',
|
||||
'cdnurl' => '',
|
||||
'version' => '1.0.1',
|
||||
'timezone' => 'Asia/Shanghai',
|
||||
'forbiddenip' => '',
|
||||
'languages' =>
|
||||
array (
|
||||
'backend' => 'zh-cn',
|
||||
'frontend' => 'zh-cn',
|
||||
),
|
||||
'fixedpage' => 'dashboard',
|
||||
'categorytype' =>
|
||||
array (
|
||||
'default' => 'Default',
|
||||
'page' => 'Page',
|
||||
'article' => 'Article',
|
||||
'test' => 'Test',
|
||||
),
|
||||
'configgroup' =>
|
||||
array (
|
||||
'basic' => 'Basic',
|
||||
'email' => 'Email',
|
||||
'dictionary' => 'Dictionary',
|
||||
'user' => 'User',
|
||||
'example' => 'Example',
|
||||
),
|
||||
'attachmentcategory' =>
|
||||
array (
|
||||
'category1' => 'Category1',
|
||||
'category2' => 'Category2',
|
||||
'custom' => 'Custom',
|
||||
),
|
||||
'mail_type' => '1',
|
||||
'mail_smtp_host' => 'smtp.qq.com',
|
||||
'mail_smtp_port' => '465',
|
||||
'mail_smtp_user' => '',
|
||||
'mail_smtp_pass' => '',
|
||||
'mail_verify_type' => '2',
|
||||
'mail_from' => '',
|
||||
);
|
||||
|
||||
@@ -13,7 +13,6 @@ class Index extends Frontend
|
||||
|
||||
public function index()
|
||||
{
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
define('APP_PATH', __DIR__ . '/../application/');
|
||||
|
||||
// 判断是否安装
|
||||
if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
|
||||
header("location:./install.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
//if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
|
||||
// header("location:./install.php");
|
||||
// exit;
|
||||
//}
|
||||
//var_dump(1111);die;
|
||||
// 加载框架引导文件
|
||||
require __DIR__ . '/../thinkphp/start.php';
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?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 <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
// [ 安装文件 ]
|
||||
// 建议安装完成后移除此文件
|
||||
// 定义应用目录
|
||||
define('APP_PATH', __DIR__ . '/../application/');
|
||||
|
||||
// 加载框架引导文件
|
||||
require __DIR__ . '/../thinkphp/base.php';
|
||||
|
||||
// 绑定到安装控制器
|
||||
\think\Route::bind('\app\admin\command\Install', 'controller');
|
||||
|
||||
// 开启路由
|
||||
\think\App::route(true);
|
||||
|
||||
// 设置根url
|
||||
\think\Url::root('');
|
||||
|
||||
// 执行应用
|
||||
\think\App::run()->send();
|
||||
@@ -16,10 +16,10 @@
|
||||
define('APP_PATH', __DIR__ . '/../application/');
|
||||
|
||||
// 判断是否安装
|
||||
if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
|
||||
header("location:./install.php");
|
||||
exit;
|
||||
}
|
||||
//if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
|
||||
// header("location:./install.php");
|
||||
// exit;
|
||||
//}
|
||||
|
||||
// 加载框架引导文件
|
||||
require __DIR__ . '/../thinkphp/base.php';
|
||||
Reference in New Issue
Block a user