瀏覽代碼

feat: add local config and db sql

jiangzixin 1 年之前
父節點
當前提交
6d56a1d043

+ 7 - 7
server/.gitignore

@@ -30,7 +30,7 @@ phpunit.phar
 dump.rdb
 
 
-# env
+# env 建议加入忽略列表
 #/.env
 
 #web assets
@@ -49,10 +49,10 @@ install.php
 /web/*.txt
 
 
-#本地配置文件
-*main-local.php
-*params-local.php
-*TestController.php
+#本地配置文件 建议加入忽略列表
+#*main-local.php
+#*params-local.php
 
-#数据库脚本备份文件
-*.sql
+
+#数据库脚本备份文件  建议加入忽略列表
+#*.sql

+ 54 - 0
server/api/config/params-local.php

@@ -0,0 +1,54 @@
+<?php
+return [
+    'user.passwordResetTokenExpire' => 3600,
+    'webuploader_driver' => env('WEBUPLOADER_DRIVER', 'local'),
+    'webuploader_qiniu_config' => [
+        'domain' => env('WEBUPLOADER_QINIU_DOMAIN'),
+        'bucket' => env('WEBUPLOADER_QINIU_BUCKET'),
+        'accessKey' => env('WEBUPLOADER_QINIU_ACCESS'),
+        'secretKey' => env('WEBUPLOADER_QINIU_SECRET'),
+    ],
+    'wx'=>[
+        //  公众号信息
+        'mp'=>[
+            /**
+             * 账号基本信息,请从微信公众平台
+             */
+            'app_id'  => '',         // AppID
+            'secret'  => '',     // AppSecret
+            'token'   => '',          // Token
+            'encodingAESKey'=>'',// 消息加解密密钥,该选项需要和公众号后台设置保持一直
+            'safeMode'=>0,//0-明文 1-兼容 2-安全,该选项需要和公众号后台设置保持一直
+
+            'payment'=>[
+                'mch_id'        =>  '',
+                'key'           =>  '',
+                'notify_url'    =>  '',
+                'cert_path'     => '', // XXX: 绝对路径!!!!
+                'key_path'      => '',      // XXX: 绝对路径!!!!
+            ],
+
+            'oauth' => [
+                'scopes'   => 'snsapi_userinfo',
+                'callback' => urlencode(''),// 授权回调
+            ],
+        ],
+        'mini'=>[
+            'app_id'  => '',
+            'secret'  => '',
+            'payment' => [
+                'mch_id'        => '',
+                'key'           => '',
+                'sp' =>[
+                    //服务商参数
+                    'appid' => '',
+                    'mch_id' => '',
+                    'key' => '',
+                    //特约商户参数
+                    'sub_appid' => '',
+                    'sub_mch_id' => '',
+                ]
+            ],
+        ]
+    ],
+];

+ 16 - 0
server/backend/config/main-local.php

@@ -0,0 +1,16 @@
+<?php
+
+$config = [
+    'components' => [
+        'request' => [
+            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
+            'cookieValidationKey' => env('BACKEND_COOKIE_VALIDATION_KEY')
+        ],
+        'urlManager' => [
+            'enablePrettyUrl' => env('backend_enable_pretty_url', true),
+            'showScriptName' => false,
+        ],
+    ],
+];
+
+return $config;

+ 48 - 0
server/common/config/main-local.php

@@ -0,0 +1,48 @@
+<?php
+
+$config = [
+    'components' => [
+        'db' => [
+            'class' => 'yii\db\Connection',
+            'dsn' => env('DB_DSN'),
+            'username' => env('DB_USERNAME'),
+            'password' => env('DB_PASSWORD'),
+            'charset' => 'utf8',
+            'tablePrefix' => env('DB_TABLE_PREFIX'),
+            'enableSchemaCache' => YII_ENV_PROD,
+        ],
+        'redis' => [
+            'class' => 'yii\redis\Connection',
+            'hostname' => env('REDIS_HOST', '127.0.0.1'),
+            'port' => env('REDIS_PORT', 6379),
+            'password' => env('REDIS_PASSWORD', null),
+            'database' => 0,
+        ],
+        'mailer' => [
+            'class' => 'yii\swiftmailer\Mailer',
+            'viewPath' => '@common/mail',
+            'messageConfig' => [
+                'charset' => 'UTF-8',
+                'from' => env('MAIL_USERNAME')
+            ],
+            // send all mails to a file by default. You have to set
+            // 'useFileTransport' to false and configure a transport
+            // for the mailer to send real emails.
+            'useFileTransport' => false,
+            'transport' => [
+                'class' => 'Swift_SmtpTransport',
+                'host' => env('MAIL_HOST'),
+                'username' => env('MAIL_USERNAME'),
+                'password' => env('MAIL_PASSWORD'),
+                'port' => env('MAIL_PORT'),
+                'encryption' => env('MAIL_ENCRYPTION')
+            ],
+        ],
+        'xunsearch' => [
+            'class' => 'hightman\xunsearch\Connection',
+            'iniDirectory' => '@common/config',    // 搜索 ini 文件目录,默认:@vendor/hightman/xunsearch/app
+            'charset' => 'utf-8',   // 指定项目使用的默认编码,默认即时 utf-8,可不指定
+        ]
+    ],
+];
+return $config;

File diff suppressed because it is too large
+ 3857 - 0
server/database/rencai_jiangzi_.sql


Some files were not shown because too many files changed in this diff