params.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. 'shanAppId' => 'ss9QcKVXwvcMTkHzw',
  55. 'shanAppSecret' => '5ivRvyBXLrprGPssYUUvpKXwoZAojwDg',
  56. ];
  57. $prefixHttp = 'http://';
  58. $userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
  59. if (strpos($userAgent, 'miniprogram') === true) {
  60. $prefixHttp = 'https://';
  61. }
  62. $referrer = isset($_SERVER["HTTP_REFERER"]) ? strtolower($_SERVER["HTTP_REFERER"]) : '';
  63. if (strpos($referrer, 'servicewechat.com') === true) {
  64. $prefixHttp = 'https://';
  65. }
  66. if (strpos($referrer, 'https') === true) {
  67. $prefixHttp = 'https://';
  68. }
  69. if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
  70. $prefixHttp = 'https://';
  71. }
  72. if (getenv('YII_ENV') == 'local') {
  73. $config['hdHost'] = $prefixHttp . 'api.shop.huaml.com';
  74. $config['hdDomain'] = $prefixHttp . 'shop.huaml.com';
  75. $config['hdPtHost'] = $prefixHttp . 'api.pt.huaml.com';
  76. $config['hdShortHost'] = 'huaml.com';
  77. //本机号码登录使用线上域名不要修改
  78. $config['hdUniCloudHost'] = 'http://unicloud.huahb.cn';
  79. $config['hdImgHost'] = $prefixHttp . 'img.huaml.com/';
  80. $config['hdWssHost'] = 'wss://chat.shop.huaml.com';
  81. $config['ghsHost'] = $prefixHttp . 'api.shop.hzghd.com';
  82. $config['ghsDomain'] = $prefixHttp . 'shop.hzghd.com';
  83. $config['ghsPtHost'] = $prefixHttp . 'api.pt.hzghd.com';
  84. //本机号码登录使用线上域名不要修改
  85. $config['ghsUniCloudHost'] = 'http://unicloud.wixhb.com';
  86. $config['ghsShortHost'] = 'hzghd.com';
  87. $config['ghsImgHost'] = $prefixHttp . 'img.hzghd.com/';
  88. $config['ghsWssHost'] = 'wss://chat.shop.huaml.com';
  89. $config['mallHost'] = $prefixHttp . 'api.shop.theflorist.cn';
  90. $config['mallDomain'] = $prefixHttp . 'shop.theflorist.cn';
  91. $config['mallPtHost'] = $prefixHttp . 'api.pt.theflorist.cn';
  92. $config['mallShortHost'] = 'theflorist.cn';
  93. //本机号码登录使用线上域名不要修改
  94. $config['mallUniCloudHost'] = 'http://unicloud.zhiguanhua.cn';
  95. $config['mallImgHost'] = $prefixHttp . 'img.theflorist.cn/';
  96. $config['mallWssHost'] = 'wss://chat.shop.huaml.com';
  97. $config['ossBucket'] = 'pic-hhb-cs';
  98. $config['expressShanUrl'] = 'http://open.s.bingex.com';
  99. }
  100. if (getenv('YII_ENV') == 'test') {
  101. $config['hdHost'] = $prefixHttp . 'api.shop.huaml.com';
  102. $config['hdDomain'] = $prefixHttp . 'shop.huaml.com';
  103. $config['hdPtHost'] = $prefixHttp . 'api.pt.huaml.com';
  104. $config['hdShortHost'] = 'huaml.com';
  105. //本机号码登录使用线上域名不要修改
  106. $config['hdUniCloudHost'] = 'http://unicloud.huahb.cn';
  107. $config['hdImgHost'] = $prefixHttp . 'img.huaml.com/';
  108. $config['hdWssHost'] = 'wss://chat.shop.huaml.com';
  109. $config['ghsHost'] = $prefixHttp . 'api.shop.hzghd.com';
  110. $config['ghsDomain'] = $prefixHttp . 'shop.hzghd.com';
  111. $config['ghsPtHost'] = $prefixHttp . 'api.pt.hzghd.com';
  112. $config['ghsShortHost'] = 'hzghd.com';
  113. //本机号码登录使用线上域名不要修改
  114. $config['ghsUniCloudHost'] = 'http://unicloud.wixhb.com';
  115. $config['ghsImgHost'] = $prefixHttp . 'img.hzghd.com/';
  116. $config['ghsWssHost'] = 'wss://chat.shop.huaml.com';
  117. $config['mallHost'] = $prefixHttp . 'api.shop.theflorist.cn';
  118. $config['mallDomain'] = $prefixHttp . 'shop.theflorist.cn';
  119. $config['mallPtHost'] = $prefixHttp . 'api.pt.theflorist.cn';
  120. $config['mallShortHost'] = 'theflorist.cn';
  121. //本机号码登录使用线上域名不要修改
  122. $config['mallUniCloudHost'] = 'http://unicloud.zhiguanhua.cn';
  123. $config['mallImgHost'] = $prefixHttp . 'img.theflorist.cn/';
  124. $config['mallWssHost'] = 'wss://chat.shop.huaml.com';
  125. $config['ossBucket'] = 'pic-hhb-cs';
  126. $config['expressShanUrl'] = 'http://open.s.bingex.com';
  127. }
  128. if (getenv('YII_ENV') == 'dev') {
  129. $config['hdHost'] = $prefixHttp . 'api.shop.huaml.com';
  130. $config['hdDomain'] = $prefixHttp . 'shop.huaml.com';
  131. $config['hdPtHost'] = $prefixHttp . 'api.pt.huaml.com';
  132. $config['hdShortHost'] = 'huaml.com';
  133. $config['hdUniCloudHost'] = 'http://unicloud.huahb.cn';
  134. $config['hdImgHost'] = $prefixHttp . 'img.huaml.com/';
  135. $config['hdWssHost'] = 'wss://chat.shop.huaml.com';
  136. $config['ghsHost'] = $prefixHttp . 'api.shop.hzghd.com';
  137. $config['ghsDomain'] = $prefixHttp . 'shop.hzghd.com';
  138. $config['ghsPtHost'] = $prefixHttp . 'api.pt.hzghd.com';
  139. $config['ghsShortHost'] = 'hzghd.com';
  140. //本机号码登录使用线上域名不要修改
  141. $config['ghsUniCloudHost'] = 'http://unicloud.wixhb.com';
  142. $config['ghsImgHost'] = $prefixHttp . 'img.hzghd.com/';
  143. $config['ghsWssHost'] = 'wss://chat.shop.huaml.com';
  144. $config['mallHost'] = $prefixHttp . 'api.shop.theflorist.cn';
  145. $config['mallDomain'] = $prefixHttp . 'shop.theflorist.cn';
  146. $config['mallPtHost'] = $prefixHttp . 'api.pt.theflorist.cn';
  147. $config['mallShortHost'] = 'theflorist.cn';
  148. //本机号码登录使用线上域名不要修改
  149. $config['mallUniCloudHost'] = 'http://unicloud.zhiguanhua.cn';
  150. $config['mallImgHost'] = $prefixHttp . 'img.theflorist.cn/';
  151. $config['mallWssHost'] = 'wss://chat.shop.huaml.com';
  152. $config['ossBucket'] = 'pic-hhb-cs';
  153. $config['expressShanUrl'] = 'http://open.s.bingex.com';
  154. }
  155. if (getenv('YII_ENV') == 'production') {
  156. $config['hdHost'] = $prefixHttp . 'api.shop.huahb.cn';
  157. $config['hdDomain'] = $prefixHttp . 'shop.huahb.cn';
  158. $config['hdPtHost'] = $prefixHttp . 'api.pt.huahb.cn';
  159. $config['hdShortHost'] = 'huahb.cn';
  160. $config['hdUniCloudHost'] = 'http://unicloud.huahb.cn';
  161. $config['hdImgHost'] = $prefixHttp . 'img.huahb.cn/';
  162. $config['hdWssHost'] = 'wss://chat.shop.huahb.cn';
  163. $config['ghsHost'] = $prefixHttp . 'api.shop.wixhb.com';
  164. $config['ghsDomain'] = $prefixHttp . 'shop.wixhb.com';
  165. $config['ghsPtHost'] = $prefixHttp . 'api.pt.wixhb.com';
  166. $config['ghsShortHost'] = 'wixhb.com';
  167. $config['ghsUniCloudHost'] = 'http://unicloud.wixhb.com';
  168. $config['ghsImgHost'] = $prefixHttp . 'img.wixhb.com/';
  169. $config['ghsWssHost'] = 'wss://chat.shop.huahb.cn';
  170. $config['mallHost'] = $prefixHttp . 'api.shop.zhiguanhua.cn';
  171. $config['mallDomain'] = $prefixHttp . 'shop.zhiguanhua.cn';
  172. $config['mallPtHost'] = $prefixHttp . 'api.pt.zhiguanhua.cn';
  173. $config['mallShortHost'] = 'zhiguanhua.cn';
  174. $config['mallUniCloudHost'] = 'http://unicloud.zhiguanhua.cn';
  175. $config['mallImgHost'] = $prefixHttp . 'img.zhiguanhua.cn/';
  176. $config['mallWssHost'] = 'wss://chat.shop.huahb.cn';
  177. $config['ossBucket'] = 'pic-hhb-online';
  178. $config['expressShanUrl'] = 'http://open.ishansong.com';
  179. }
  180. return $config;