优化ctms-api语法、修复已知BUG;

主要修复ctms-api、dacms对PHP新版本的支持问题
This commit is contained in:
2025-07-13 19:37:42 +08:00
parent 65bbd06981
commit 037f274ec5
413 changed files with 107271 additions and 72326 deletions
+9 -1
View File
@@ -1,2 +1,10 @@
<?php
Yii::setAlias('@frontend', dirname(__DIR__));
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2021-03-25T10:36:00+08:00
# @Email: 1280880631@qq.com
# @Last modified by: fm453
# @Last modified time: 2024-08-09T09:09:28+08:00
# @Copyright: www.hiluker.cn
Yii::setAlias('@api', dirname(__DIR__));
-4
View File
@@ -1,4 +0,0 @@
<?php
global $_HI;
$_HI['apiCertPath'] = Yii::getAlias('@frontend/cert/');
-49
View File
@@ -1,49 +0,0 @@
<?php
$config = [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=120.79.11.71;dbname=dacms_dev',
'username' => 'dacms_dev',
'password' => 'HS8wRyTT2sKeLdAJ',
'charset' => 'utf8',
'tablePrefix' => '',
'attributes' => [
// use a smaller connection timeout
PDO::ATTR_TIMEOUT => 10,
//使用长链接
PDO::ATTR_PERSISTENT => true,
],
],
//添加CHAT数据库配置(聊天室模块)
'chatdb' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=120.79.11.71;dbname=dacms_dev',
'username' => 'dacms_dev',
'password' => 'HS8wRyTT2sKeLdAJ',
'charset' => 'utf8',
'tablePrefix' => '',
],
//添加REALTY数据库配置(房地产模块)
'realtydb' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=120.79.11.71;dbname=dacms_dev',
'username' => 'dacms_dev',
'password' => 'HS8wRyTT2sKeLdAJ',
'charset' => 'utf8',
'tablePrefix' => '',
],
//添加PAGE数据库配置(页面模块)
'pagedb' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=120.79.11.71;dbname=dacms_dev',
'username' => 'dacms_dev',
'password' => 'HS8wRyTT2sKeLdAJ',
'charset' => 'utf8',
'tablePrefix' => '',
],
],
];
return $config;
-56
View File
@@ -1,56 +0,0 @@
<?php
/**
* @Author: fm453
* @Date: 2021-09-09 10:37:17
* @Last Modified by: fm453
* @Last Modified time: 2021-09-09 10:42:24
* @Email: fm453@lukegzs.com
*/
$config = [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=dacms',
'username' => 'dacms',
'password' => 'eydnsidc',
'charset' => 'utf8',
'tablePrefix' => '',
'attributes' => [
// use a smaller connection timeout
PDO::ATTR_TIMEOUT => 10,
//使用长链接
PDO::ATTR_PERSISTENT => true,
],
],
//添加CHAT数据库配置(聊天室模块)
'chatdb' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=dacms',
'username' => 'dacms',
'password' => 'eydnsidc',
'charset' => 'utf8',
'tablePrefix' => '',
],
//添加REALTY数据库配置(房地产模块)
'realtydb' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=dacms',
'username' => 'dacms',
'password' => 'HS8wRyTT2sKeLdAJ',
'charset' => 'utf8',
'tablePrefix' => '',
],
//添加PAGE数据库配置(页面模块)
'pagedb' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=dacms',
'username' => 'dacms',
'password' => 'eydnsidc',
'charset' => 'utf8',
'tablePrefix' => '',
],
],
];
return $config;
+46 -26
View File
@@ -1,43 +1,64 @@
<?php
# @Author: 嗨噜客科技(www.hiluker.cn) <Fm453>
# @Author: fm453
# @Date: 1970-01-01T08:00:00+08:00
# @Email: fm453@hiluker.com
# @Last modified by: Fm453
# @Last modified time: 2021-09-15T00:13:16+08:00
# @Email: fm43@hiluker.com
# @Last modified by: fm453
# @Last modified time: 2024-08-09T08:21:21+08:00
$params = array_merge(
require(__DIR__ . '/../../common/config/params-api.php'),
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../addons-' . HI_APP . '/config/citys.php'),
require(__DIR__ . '/../../addons-' . HI_APP . '/config/params-car.php'),
require(__DIR__ . '/../../addons-' . HI_APP . '/config/params-letter.php'),
require(__DIR__ . '/../../addons-' . HI_APP . '/config/params-area.php'),
require(__DIR__ . '/../../addons-' . HI_APP . '/config/params.php'),
// require(__DIR__ . '/../../addons-'.HI_APP.'/config/version.php'),
require(__DIR__ . '/params.php')
);
$config = [
'id' => 'app-frontend',
'id' => 'api-ctms-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'api\controllers',
'defaultRoute' => 'index', //默认路由
'bootstrap' => ['log'],
'controllerNamespace' => 'frontend\controllers',
'modules' => [
'data' => [
'class' => 'vendor\fmsoft\modules\data\Module', //自动加载我的数据处理模型
],
// "admin" => [
// "class" => 'mdm\admin\Module',
// ],
],
'language'=>'zh-CN',
'aliases' => [
"@mdm/admin" => "@vendor/mdmsoft/yii2-admin",
],
// 'as access' => [
// //加了才会自动验证是否有权限
// 'class' => 'mdm\admin\components\AccessControl',
// 'allowActions' => [
// //允许访问的action
// //controller/action
// '*'
// ]
// ],
'language' => 'zh-CN', //目标语言
//组件
'components' => [
'request' => [
'csrfParam' => '_csrf-frontend',
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'o_Rv6TiAxMkGII4dkFBKathreA5IEohp',
'parsers' => [
'application/json' => 'yii\web\JsonParser',
]
'csrfParam' => '_csrf-backend',
'cookieValidationKey' => 'CU5iSYmIp6kbjKKuh541KsA_oaYvTuNh',
],
// //身份认证类
'user' => [
'identityClass' => 'common\models\User',
'identityClass' => 'common\models\Adminer',
'enableAutoLogin' => true,
'identityCookie' => ['name' => '_identity-frontend', 'httpOnly' => true],
'identityCookie' => ['name' => '_identity-api', 'httpOnly' => TRUE],
],
'session' => [
'name' => 'advanced-frontend-api',
'name' => 'advanced-ctms-api',
],
//Rbac权限控制
'authManager' => [
'class' => 'yii\rbac\DbManager',
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
@@ -51,17 +72,16 @@ $config = [
'errorHandler' => [
'errorAction' => 'site/error',
],
'urlManager' => [
'enablePrettyUrl' => false,
'enableStrictParsing' => true,
'enablePrettyUrl' => TRUE,
'showScriptName' => true,
'suffix' => '.hi',
'suffix' => '.453', //后缀
'rules' => [
['class' => 'yii\rest\UrlRule', 'controller' => 'realty'], //为***控制器增加一个 URL 规则。这样, 用户的数据就能通过美化的 URL 和有意义的 http 动词进行访问和操作
['class' => 'yii\rest\UrlRule', 'controller' => 'setting']
],
],
],
'params' => $params,
];
return $config;
return $config;
+4 -4
View File
@@ -1,11 +1,11 @@
<?php
# @Author: 嗨噜客科技(www.hiluker.cn) <Fm453>
# @Date: 1970-01-01T08:00:00+08:00
# @Email: fm453@hiluker.com
# @Last modified by: Fm453
# @Last modified time: 2021-09-15T00:09:07+08:00
# @Last modified by: fm453
# @Last modified time: 2024-07-09T17:30:39+08:00
return [
'adminEmail' => 'fm453@lukegzs.com',
'redis' => ['IP'=>'127.0.0.1','PORT'=>'6379']
];
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
return [
'id' => 'app-frontend-tests',
'id' => 'app-backend-tests',
'components' => [
'assetManager' => [
'basePath' => __DIR__ . '/../web/assets',