params.php 8.2 KB

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