params.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. $hostData = \common\components\httpUtil::getHttpHost();
  3. $http = $hostData['http'];
  4. $suffix = $hostData['suffix'];
  5. $miniUrl = $http . 'mini.' . $suffix;
  6. $adminUrl = $http . 'a.' . $suffix;
  7. $frontUrl = $http . 'mall.' . $suffix;
  8. $mobileUrl = $http . 'mall.' . $suffix;
  9. $openUrl = $http . 'o.' . $suffix;
  10. $picUrl = $http . 'pic.' . $suffix;
  11. $wwwUrl = $http . 'www.' . $suffix;
  12. $cssUrl = $http . 'css.' . $suffix;
  13. $jsUrl = $http . 'js.' . $suffix;
  14. $config = [
  15. //全站统一使用的秘钥
  16. 'secretKey' => 'CzWjvVY5F.dUqT65Knj81qh_eU2wI3SokO',
  17. 'adminUrl' => $adminUrl,
  18. 'frontUrl' => $frontUrl,
  19. 'openUrl' => $openUrl,
  20. 'picUrl' => $picUrl,
  21. 'wwwUrl' => $wwwUrl,
  22. 'mobileUrl' => $mobileUrl,
  23. 'miniUrl' => $miniUrl,
  24. //平台来源
  25. 'ptSource' => [
  26. //商城移动端
  27. 'mobile' => 1,
  28. //商城小程序
  29. 'mini' => 2,
  30. //商家后台PC端
  31. 'admin' => 3,
  32. //商家后台移动端
  33. 'back' => 4,
  34. //总后台
  35. 'pt' => 5,
  36. ],
  37. //永不过期时间
  38. 'neverExpireTime' => 4102416000,
  39. //永不过期日期
  40. 'neverExpireDate' => '2100-01-01 00:00:00',
  41. 'pageSize' => 20,
  42. //aliyun oss ak
  43. 'accessKeyId' => 'LTAI4GCXNRgt87qnCB8JrGFt',
  44. 'accessKeySecret' => 'm5q7aU3wGcoid9wr0yFJ4JqzHMKfks',
  45. 'endpoint' => 'oss-cn-hangzhou.aliyuncs.com',
  46. //达达相关配置
  47. 'dadaAppKey' => 'dadae6c9d6064e69cf4',
  48. 'dadaAppSecret' => '8ed3b159f64021003aa73f7233118fe6',
  49. //百度语音配置
  50. 'baiduAipAppId'=>'24236063',
  51. 'baiduAipAppKey'=>'WLp9xP7GG1FFSz6UNGaNeuSv',
  52. 'baiduAipAppSecret'=>'7gxpGeWzI2dpBVWbe8ffb11lvbtGfLOC',
  53. ];
  54. $prefixHttp = 'http://';
  55. $userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
  56. if (strpos($userAgent, 'miniprogram') === true) {
  57. $prefixHttp = 'https://';
  58. }
  59. $referrer = isset($_SERVER["HTTP_REFERER"]) ? strtolower($_SERVER["HTTP_REFERER"]) : '';
  60. if (strpos($referrer, 'servicewechat.com') === true) {
  61. $prefixHttp = 'https://';
  62. }
  63. if (strpos($referrer, 'https') === true) {
  64. $prefixHttp = 'https://';
  65. }
  66. if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
  67. $prefixHttp = 'https://';
  68. }
  69. if (getenv('YII_ENV') == 'local') {
  70. $config['hdHost'] = $prefixHttp . 'api.shop.huaml.com';
  71. $config['hdDomain'] = $prefixHttp . 'shop.huaml.com';
  72. $config['hdPtHost'] = $prefixHttp . 'api.pt.huaml.com';
  73. $config['hdShortHost'] = 'huaml.com';
  74. $config['hdImgHost'] = $prefixHttp . 'img.huaml.com/';
  75. $config['ghsHost'] = $prefixHttp . 'api.shop.hzghd.com';
  76. $config['ghsDomain'] = $prefixHttp . 'shop.hzghd.com';
  77. $config['ghsPtHost'] = $prefixHttp . 'api.pt.hzghd.com';
  78. $config['ghsShortHost'] = 'hzghd.com';
  79. $config['ghsImgHost'] = $prefixHttp . 'img.hzghd.com/';
  80. $config['mallHost'] = $prefixHttp . 'api.shop.theflorist.cn';
  81. $config['mallDomain'] = $prefixHttp . 'shop.theflorist.cn';
  82. $config['mallPtHost'] = $prefixHttp . 'api.pt.theflorist.cn';
  83. $config['mallShortHost'] = 'theflorist.cn';
  84. $config['mallImgHost'] = $prefixHttp . 'img.theflorist.cn/';
  85. $config['ossBucket'] = 'pic-hhb-cs';
  86. }
  87. if (getenv('YII_ENV') == 'test') {
  88. $config['hdHost'] = $prefixHttp . 'api.shop.huaml.com';
  89. $config['hdDomain'] = $prefixHttp . 'shop.huaml.com';
  90. $config['hdPtHost'] = $prefixHttp . 'api.pt.huaml.com';
  91. $config['hdShortHost'] = 'huaml.com';
  92. $config['hdImgHost'] = $prefixHttp . 'img.huaml.com/';
  93. $config['ghsHost'] = $prefixHttp . 'api.shop.hzghd.com';
  94. $config['ghsDomain'] = $prefixHttp . 'shop.hzghd.com';
  95. $config['ghsPtHost'] = $prefixHttp . 'api.pt.hzghd.com';
  96. $config['ghsShortHost'] = 'hzghd.com';
  97. $config['ghsImgHost'] = $prefixHttp . 'img.hzghd.com/';
  98. $config['mallHost'] = $prefixHttp . 'api.shop.theflorist.cn';
  99. $config['mallDomain'] = $prefixHttp . 'shop.theflorist.cn';
  100. $config['mallPtHost'] = $prefixHttp . 'api.pt.theflorist.cn';
  101. $config['mallShortHost'] = 'theflorist.cn';
  102. $config['mallImgHost'] = $prefixHttp . 'img.theflorist.cn/';
  103. $config['ossBucket'] = 'pic-hhb-cs';
  104. }
  105. if (getenv('YII_ENV') == 'dev') {
  106. $config['hdHost'] = $prefixHttp . 'api.shop.huaml.com';
  107. $config['hdDomain'] = $prefixHttp . 'shop.huaml.com';
  108. $config['hdPtHost'] = $prefixHttp . 'api.pt.huaml.com';
  109. $config['hdShortHost'] = 'huaml.com';
  110. $config['hdImgHost'] = $prefixHttp . 'img.huaml.com/';
  111. $config['ghsHost'] = $prefixHttp . 'api.shop.hzghd.com';
  112. $config['ghsDomain'] = $prefixHttp . 'shop.hzghd.com';
  113. $config['ghsPtHost'] = $prefixHttp . 'api.pt.hzghd.com';
  114. $config['ghsShortHost'] = 'hzghd.com';
  115. $config['ghsImgHost'] = $prefixHttp . 'img.hzghd.com/';
  116. $config['mallHost'] = $prefixHttp . 'api.shop.theflorist.cn';
  117. $config['mallDomain'] = $prefixHttp . 'shop.theflorist.cn';
  118. $config['mallPtHost'] = $prefixHttp . 'api.pt.theflorist.cn';
  119. $config['mallShortHost'] = 'theflorist.cn';
  120. $config['mallImgHost'] = $prefixHttp . 'img.theflorist.cn/';
  121. $config['ossBucket'] = 'pic-hhb-cs';
  122. }
  123. if (getenv('YII_ENV') == 'production') {
  124. $config['hdHost'] = $prefixHttp . 'api.shop.huahb.cn';
  125. $config['hdDomain'] = $prefixHttp . 'shop.huahb.cn';
  126. $config['hdPtHost'] = $prefixHttp . 'api.pt.huahb.cn';
  127. $config['hdShortHost'] = 'huahb.cn';
  128. $config['hdImgHost'] = $prefixHttp . 'img.huahb.cn/';
  129. $config['ghsHost'] = $prefixHttp . 'api.shop.wixhb.com';
  130. $config['ghsDomain'] = $prefixHttp . 'shop.wixhb.com';
  131. $config['ghsPtHost'] = $prefixHttp . 'api.pt.wixhb.com';
  132. $config['ghsShortHost'] = 'wixhb.com';
  133. $config['ghsImgHost'] = $prefixHttp . 'img.wixhb.com/';
  134. $config['mallHost'] = $prefixHttp . 'api.shop.zhiguanhua.cn';
  135. $config['mallDomain'] = $prefixHttp . 'shop.zhiguanhua.cn';
  136. $config['mallPtHost'] = $prefixHttp . 'api.pt.zhiguanhua.cn';
  137. $config['mallShortHost'] = 'zhiguanhua.cn';
  138. $config['mallImgHost'] = $prefixHttp . 'img.zhiguanhua.cn/';
  139. $config['ossBucket'] = 'pic-hhb-cs';
  140. }
  141. return $config;