modified 构建安装脚本

This commit is contained in:
zhaoxiang 2019-04-24 16:25:46 +08:00
parent 5459299af1
commit 09fc2888ea
4 changed files with 106 additions and 3 deletions

View File

@ -3,10 +3,12 @@
namespace app\api\controller; namespace app\api\controller;
use think\facade\App;
class Index extends Base { class Index extends Base {
public function index() { public function index() {
$this->debug([ $this->debug([
'TpVersion' => THINK_VERSION 'TpVersion' => App::version()
]); ]);
return $this->buildSuccess([ return $this->buildSuccess([

View File

@ -0,0 +1,38 @@
<?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>
// +----------------------------------------------------------------------
return [
'APP_VERSION' => 'v4.0',
'APP_NAME' => 'ApiAdmin',
//鉴权相关
'USER_ADMINISTRATOR' => [1],
//安全秘钥
'AUTH_KEY' => '{$AUTH_KEY}',
//后台登录状态维持时间[目前只有登录和解锁会重置登录时间]
'ONLINE_TIME' => 7200,
//AccessToken失效时间
'ACCESS_TOKEN_TIME_OUT' => 7200,
'COMPANY_NAME' => 'ApiAdmin开发维护团队',
//跨域配置
'CROSS_DOMAIN' => [
'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Methods' => 'POST,PUT,GET,DELETE',
'Access-Control-Allow-Headers' => 'version, access-token, user-token, ApiAuth, User-Agent, Keep-Alive, Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With',
'Access-Control-Allow-Credentials' => 'true'
],
//后台列表默认一页显示数量
'ADMIN_LIST_DEFAULT' => 20,
];

View File

@ -0,0 +1,63 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
return [
// 数据库类型
'type' => '{$DB_TYPE}',
// 服务器地址
'hostname' => '{$DB_HOST}',
// 数据库名
'database' => '{$DB_NAME}',
// 用户名
'username' => '{$DB_USER}',
// 密码
'password' => '{$DB_PASSWORD}',
// 端口
'hostport' => '{$DB_PORT}',
// 连接dsn
'dsn' => '',
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => '{$DB_CHAR}',
// 数据库表前缀
'prefix' => '',
// 数据库调试模式
'debug' => true,
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
'rw_separate' => false,
// 读写分离后 主服务器数量
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// 自动读取主库数据
'read_master' => false,
// 是否严格检查字段是否存在
'fields_strict' => true,
// 数据集返回类型
'resultset_type' => 'array',
// 自动写入时间戳字段
'auto_timestamp' => false,
// 时间字段取出后的默认时间格式
'datetime_format' => 'Y-m-d H:i:s',
// 是否需要进行SQL性能分析
'sql_explain' => false,
// Builder类
'builder' => '',
// Query类
'query' => '\\think\\db\\Query',
// 是否需要断线重连
'break_reconnect' => false,
// 断线标识字符串
'break_match_str' => [],
];

View File

@ -54,9 +54,9 @@ return [
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// 默认模块名 // 默认模块名
'default_module' => 'index', 'default_module' => 'api',
// 禁止访问模块 // 禁止访问模块
'deny_module_list' => ['common'], 'deny_module_list' => ['http', 'install', 'model', 'util'],
// 默认控制器名 // 默认控制器名
'default_controller' => 'Index', 'default_controller' => 'Index',
// 默认操作名 // 默认操作名