route.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. use think\Env;
  12. use think\Route;
  13. //正式生产环境
  14. if (APP_STATUS == 'stable') {
  15. $domain = [
  16. 'sdkapi' => 'api',
  17. 't' => 'api',
  18. 'sdkcpsapi' => 'guildapi', // 后续可以把这个删除了,统一用 cpsapi
  19. 'cpsapi' => 'guildapi',
  20. 'mcpsapi' => 'mcpsapi',
  21. 'jhgame' => 'complex',
  22. 'www' => 'home',
  23. 'admin' => 'admin',
  24. 'm' => 'mobile',
  25. '*' => 'home',
  26. ];
  27. }
  28. //测试环境
  29. elseif (APP_STATUS == 'dev') {
  30. $domain = [
  31. 'devsdkapi' => 'api',
  32. 'devt' => 'api',
  33. 'devsdkcpsapi' => 'guildapi',
  34. 'devcpsapi' => 'guildapi',
  35. 'devmcpsapi' => 'mcpsapi',
  36. 'devjhgame' => 'complex',
  37. 'devadmin' => 'admin',
  38. 'devm' => 'mobile',
  39. 'devwww' => 'home',
  40. '*' => 'home'
  41. ];
  42. }
  43. //开发环境
  44. else {
  45. $domain = [
  46. 'sdkapi' => 'api',
  47. 't' => 'api',
  48. 'devsdkcpsapi' => 'guildapi',
  49. 'cpsapi' => 'guildapi',
  50. 'mcpsapi' => 'mcpsapi',
  51. 'jhgame' => 'complex',
  52. 'admin' => 'admin',
  53. 'www' => 'home',
  54. 'm' => 'mobile',
  55. '*' => 'home'
  56. ];
  57. }
  58. define('PC_WEBSITE_DOMAIN', 'www.' . QM_DOMAIN_URL);
  59. define('MOBILE_WEBSITE_DOMAIN', 'm.' . QM_DOMAIN_URL);
  60. // --------- 推广 ---------
  61. // 推广页
  62. if (pathinfo($_SERVER['REQUEST_URI'])['dirname'] == '/tgy') {
  63. $short_link = pathinfo($_SERVER['REQUEST_URI'])['filename'];
  64. $arrAlias = db('nw_promotion_short_link')->where(['short_link' => $short_link])->field('short_link,channel_id')->find();
  65. if ($arrAlias) {
  66. $routeSetting['[tgy/:cid]'] = [
  67. '[:0]' => ['api/game/index?cid=' . base64_encode(auth_code($arrAlias['channel_id'], "ENCODE", Env::get('auth_key')))],
  68. ];
  69. return $routeSetting;
  70. }
  71. }
  72. // 推广短链
  73. // TODO: 修复祈盟域名的问题 `|| (strpos($_SERVER['HTTP_HOST'], 't.qmgames.cn') !== false || strpos($_SERVER['SERVER_NAME'], 't.qmgames.cn') !== false)`
  74. if ((strpos($_SERVER['HTTP_HOST'], T_DOMAIN_URL) !== false || strpos($_SERVER['SERVER_NAME'], T_DOMAIN_URL) !== false) || (strpos($_SERVER['HTTP_HOST'], 't.7dgame.cn') !== false || strpos($_SERVER['SERVER_NAME'], 't.7dgame.cn') !== false)) {
  75. $short_link = pathinfo($_SERVER['REQUEST_URI'])['filename'];
  76. if (strpos($short_link, '?')) {
  77. $short_link = substr($short_link, 0, strpos($short_link, '?'));
  78. }
  79. if ($short_link != 'index') {
  80. $shortLinkInfo = db('nw_promotion_short_link')->where(['short_link' => $short_link])->column('short_link,id');
  81. if (!empty($shortLinkInfo)) {
  82. $arrAlias = [];
  83. if (is_numeric($short_link)) {
  84. Route::get('/:mark', 'api/game_promotion/index');
  85. } else {
  86. foreach ($shortLinkInfo as $key => $value) {
  87. $arrAlias[$key] = 'api/game_promotion/index';
  88. }
  89. }
  90. $routeSetting['__alias__'] = $arrAlias;
  91. return $routeSetting;
  92. } else {
  93. Route::rule('/:mark', function (\think\Request $request) {
  94. return "当前短链不存在!";
  95. });
  96. }
  97. }
  98. }
  99. // ------------------
  100. // TODO: 前后端路由冲突配置,解决方案。后续可优化。
  101. if ($_SERVER['HTTP_HOST'] == PC_WEBSITE_DOMAIN || $_SERVER['HTTP_HOST'] == PC_WEBSITE_DOMAIN . ':80') {
  102. $route_login = ['Home/member/login', []];
  103. $route_register = ['Home/member/phoneReg', []];
  104. $route_kefu_cjwt = ['Home/csc/index', []];
  105. $route_kefu_zhss = ['Home/csc/appeal', []];
  106. $route_kefu_sscx = ['Home/csc/appealResult', []];
  107. $route_kefu_wxss = ['Home/csc/wechatAppeal', []];
  108. $route_gift_index = ['Home/gift/index', []];
  109. // $route_gift_news = ['Home/gift/news', []];
  110. } else {
  111. $route_login = ['Home/member/login', ['domain' => PC_WEBSITE_DOMAIN]];
  112. $route_register = ['Home/member/phoneReg', ['domain' => PC_WEBSITE_DOMAIN]];
  113. $route_kefu_cjwt = ['Home/csc/index', ['domain' => PC_WEBSITE_DOMAIN]];
  114. $route_kefu_zhss = ['Home/csc/appeal', ['domain' => PC_WEBSITE_DOMAIN]];
  115. $route_kefu_sscx = ['Home/csc/appealResult', ['domain' => PC_WEBSITE_DOMAIN]];
  116. $route_kefu_wxss = ['Home/csc/wechatAppeal', ['domain' => PC_WEBSITE_DOMAIN]];
  117. $route_gift_index = ['Home/gift/index', ['domain' => PC_WEBSITE_DOMAIN]];
  118. // $route_gift_news = ['Home/gift/news', ['domain'=>PC_WEBSITE_DOMAIN]];
  119. }
  120. //PC站路由配置
  121. Route::get('game<id>/<type>', 'Home/Game/detail', ['domain' => PC_WEBSITE_DOMAIN], ['id' => '\d+', 'type' => 'index|info|news|gift|kfkc']);
  122. Route::get('game<id>', 'Home/Game/info', ['domain' => PC_WEBSITE_DOMAIN], ['id' => '\d+']);
  123. Route::get('forgotpwd/result<res>', 'Home/member/forgetPwdResult', ['domain' => PC_WEBSITE_DOMAIN], ['res' => '\d+']);
  124. Route::get('user/zhaq/bind/selc/<type>', 'Home/member/toBindOne', ['domain' => PC_WEBSITE_DOMAIN], ['type' => 'mobile|email']);
  125. Route::get('user/zhaq/bind/validate/<type>', 'Home/member/toVelidatePage', ['domain' => PC_WEBSITE_DOMAIN], ['type' => 'mobile|email']);
  126. Route::get('user/zhaq/bindpage', 'Home/member/bindPage', ['domain' => PC_WEBSITE_DOMAIN], []);
  127. // 微信小程序获取openid
  128. // Route::get('three_platform/getWxAuthCode', 'Api/ThreePlatform/getWxAuthCode', [], []);
  129. // \think\Route::get('upload_notify/index' , 'Admin/upload_notify/index' , [] , []);
  130. // \think\Route::alias('t_rally','api/game/index'); // TODO: 推广集合页短链
  131. Route::post('mp/get_wxmp_code', 'Api/ThreePlatform/getWxAuthCode');
  132. Route::post('mp/get_order_info', 'Api/ThreePlatform/getOrderInfo');
  133. Route::post('mp/get_pay', 'Api/ThreePlatform/getPay');
  134. Route::get('mp/get_article_list', 'Api/ThreePlatform/getArticleList');
  135. Route::get('mp/get_article_info', 'Api/ThreePlatform/getArticleInfo');
  136. Route::get('mlbb/:code', 'Api/Index/mlbbDownload');
  137. Route::get('get_mlbb_code', 'Api/Index/getMlbbCode');
  138. Route::get('test_pay', 'Api/Index/pay');
  139. // Route::get('wxPay', 'Api/Index/wxPay');
  140. // 聚合API
  141. Route::post('/gh/get_role', 'Api/JhApi/getRole');
  142. Route::post('/gh/get_sub', 'Api/JhApi/getSubList');
  143. Route::post('/gh/channel_data_summary', 'Api/JhApi/getChannelDataSummary');
  144. Route::post('/gh/channel_data_summary_v2', 'Api/JhApi/getChannelDataSummaryV2');
  145. Route::post('/gh/get_pay_list', 'Api/JhApi/getPayList');
  146. Route::post('/gh/get_sub_user_list', 'Api/JhApi/getSubUserList');
  147. Route::get('/game/detail', 'Api/Game/detail'); // 推广页 - 游戏详情页
  148. //路由配置
  149. $routeSetting = [
  150. '__pattern__' => [
  151. 'name' => '\w+',
  152. ],
  153. '[hello]' => [
  154. ':id' => ['index/hello', ['method' => 'get', 'domain' => PC_WEBSITE_DOMAIN], ['id' => '\d+']],
  155. ':name' => ['index/hello', ['method' => 'post', 'domain' => PC_WEBSITE_DOMAIN]],
  156. ],
  157. //PC站路由配置
  158. 'game/:type/:subject' => ['Home/Game/index', ['domain' => PC_WEBSITE_DOMAIN]],
  159. '[news]' => [
  160. ':id' => ['Home/News/detail', ['method' => 'get', 'domain' => PC_WEBSITE_DOMAIN], ['id' => '\d+']],
  161. ],
  162. '[news/index]' => [
  163. '[:0]' => ['Home/news/index?type=1', ['domain' => PC_WEBSITE_DOMAIN]],
  164. ],
  165. '[news/xyzx]' => [
  166. '[:0]' => ['Home/news/index?type=1', ['domain' => PC_WEBSITE_DOMAIN]],
  167. ],
  168. '[news/lyzx]' => [
  169. '[:0]' => ['Home/news/index?type=2', ['domain' => PC_WEBSITE_DOMAIN]],
  170. ],
  171. '[news/xypc]' => [
  172. '[:0]' => ['Home/news/index?type=3', ['domain' => PC_WEBSITE_DOMAIN]],
  173. ],
  174. '[news/xygl]' => [
  175. '[:0]' => ['Home/news/index?type=4', ['domain' => PC_WEBSITE_DOMAIN]],
  176. ],
  177. '[news/jcsp]' => [
  178. '[:0]' => ['Home/news/index?type=5', ['domain' => PC_WEBSITE_DOMAIN]],
  179. ],
  180. '[gift/index]' => [
  181. '[:0]' => ['Home/gift/index', ['domain' => PC_WEBSITE_DOMAIN]],
  182. ],
  183. '[gift/new]' => [
  184. '[:0]' => ['Home/gift/news', ['domain' => PC_WEBSITE_DOMAIN]],
  185. ],
  186. '[gift/hot]' => [
  187. '[:0]' => ['Home/gift/index', ['domain' => PC_WEBSITE_DOMAIN]],
  188. ],
  189. '[gift]' => [
  190. ':id' => ['Home/gift/detail', ['method' => 'get', 'domain' => PC_WEBSITE_DOMAIN], ['id' => '\d+']],
  191. ],
  192. '[fastgame]' => [
  193. '[:0]' => ['Home/gameaid/index', ['domain' => PC_WEBSITE_DOMAIN]],
  194. ],
  195. '[login]' => [
  196. '[:0]' => $route_login,
  197. ],
  198. 'search/keyword/:keyword' => ['Home/search/index', ['domain' => PC_WEBSITE_DOMAIN]],
  199. '[register]' => [
  200. '[:0]' => $route_register,
  201. ],
  202. 'forgotpwd' => ['Home/member/contactAccount', ['domain' => PC_WEBSITE_DOMAIN]],
  203. 'forgotpwd/check' => ['Home/member/contactWay', ['domain' => PC_WEBSITE_DOMAIN]],
  204. 'forgotpwd/check/email' => ['Home/member/contact?type=email', ['domain' => PC_WEBSITE_DOMAIN]],
  205. 'forgotpwd/check/mobile' => ['Home/member/contact?type=phone', ['domain' => PC_WEBSITE_DOMAIN]],
  206. 'forgotpwd/resetpwd' => ['Home/member/forgetPwdToReset', ['domain' => PC_WEBSITE_DOMAIN]],
  207. 'syxy' => ['Home/index/agreement', ['domain' => PC_WEBSITE_DOMAIN]],
  208. 'kf' => ['Home/service/index', ['domain' => PC_WEBSITE_DOMAIN]],
  209. 'kc' => ['Home/service/kc', ['domain' => PC_WEBSITE_DOMAIN]],
  210. 'user/userinfo' => ['Home/member/personalInfo', ['domain' => PC_WEBSITE_DOMAIN]],
  211. 'user/userinfo/edit' => ['Home/member/personalInfoEdit', ['domain' => PC_WEBSITE_DOMAIN]],
  212. 'user/rechargeinfo' => ['Home/member/personalPay', ['domain' => PC_WEBSITE_DOMAIN]],
  213. 'user/giftbox' => ['Home/member/memberGift', ['domain' => PC_WEBSITE_DOMAIN]],
  214. 'user/zhaq' => ['Home/member/personalAccount', ['domain' => PC_WEBSITE_DOMAIN]],
  215. 'user/zhaq/changepwd' => ['Home/member/personalChangePwd', ['domain' => PC_WEBSITE_DOMAIN]],
  216. 'user/zhaq/realname' => ['Home/member/personalIdentityPage', ['domain' => PC_WEBSITE_DOMAIN]],
  217. 'user/mygame' => ['Home/member/mygame', ['domain' => PC_WEBSITE_DOMAIN]],
  218. '[kefu/cjwt]' => [
  219. '[:type]' => $route_kefu_cjwt
  220. ],
  221. 'kefu/zhss' => $route_kefu_zhss,
  222. 'kefu/sscx' => $route_kefu_sscx,
  223. 'kefu/wxss' => $route_kefu_wxss,
  224. 'gift/index' => $route_gift_index,
  225. // 'gift/news' => $route_gift_news,
  226. '[download]' => [
  227. ':id' => ['Home/game/download', ['method' => 'get', 'domain' => PC_WEBSITE_DOMAIN], ['id' => '\d+']],
  228. ],
  229. '[download/fastgame]' => [
  230. ':id' => ['Home/gameaid/download', ['method' => 'get', 'domain' => PC_WEBSITE_DOMAIN], ['id' => '\d+']],
  231. ],
  232. 'feedback' => ['Home/member/feedback', ['domain' => PC_WEBSITE_DOMAIN]],
  233. //域名路由配置
  234. '__domain__' => $domain,
  235. ];
  236. // 官网pc站和m站路由冲突解决
  237. $isDebug = false; // 默认为开启调试模式
  238. if (isset($_SERVER['HTTP_HOST'])) {
  239. $url = 'http://' . $_SERVER['HTTP_HOST']; // 获取访问URL
  240. $debugArr = [MOBILE_SITE_DOMAIN, 'http://' . MOBILE_WEBSITE_DOMAIN]; // 关闭调试模式的模块名,如果做了伪静态则要根据URL来区别对待了
  241. $i = count($debugArr);
  242. while ($i) {
  243. $i--;
  244. if (strpos($url, $debugArr[$i]) !== false) {
  245. $isDebug = true;
  246. break;
  247. }
  248. }
  249. }
  250. if ($isDebug) {
  251. //M站路由配置
  252. Route::get('game<id>/<type>', 'Mobile/Game/detail', ['domain' => MOBILE_WEBSITE_DOMAIN], ['id' => '\d+', 'type' => 'index|info|news|gift']);
  253. Route::get('game<id>', 'Mobile/Game/info', ['domain' => MOBILE_WEBSITE_DOMAIN], ['id' => '\d+']);
  254. Route::post('game<id>/<type>', 'Mobile/Game/detail', ['domain' => MOBILE_WEBSITE_DOMAIN], ['id' => '\d+', 'type' => 'index|info|news|gift']);
  255. Route::post('game<id>', 'Mobile/Game/info', ['domain' => MOBILE_WEBSITE_DOMAIN], ['id' => '\d+']);
  256. Route::any('game/type=<type>', 'Mobile/Game/index', ['domain' => MOBILE_WEBSITE_DOMAIN], ['type' => '\d+']);
  257. Route::any('game/subject=<subject>', 'Mobile/Game/index', ['domain' => MOBILE_WEBSITE_DOMAIN], ['subject' => '\d+']);
  258. Route::get('user/zhaq/bind/selc/<type>', 'Mobile/member/toBindOne', ['domain' => MOBILE_WEBSITE_DOMAIN], ['type' => 'mobile|email']);
  259. Route::get('user/zhaq/bind/validate/<type>', 'Mobile/member/toVelidatePage', ['domain' => MOBILE_WEBSITE_DOMAIN], ['type' => 'mobile|email']);
  260. Route::get('user/zhaq/bindpage', 'Mobile/member/bindPage', ['domain' => MOBILE_WEBSITE_DOMAIN], []);
  261. Route::get('user/rechargeinfo/detail/<id>', 'Mobile/member/personalPayDetail', ['domain' => MOBILE_WEBSITE_DOMAIN], ['id' => '\d+']);
  262. //M站路由配置
  263. $routeMobile = [
  264. '[tj/rmyx]' => [
  265. '[:0]' => ['Mobile/Game/gameList?type=hot', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  266. ],
  267. '[tj/zxyx]' => [
  268. '[:0]' => ['Mobile/Game/gameList?type=new', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  269. ],
  270. '[tj/bztj]' => [
  271. '[:0]' => ['Mobile/Game/gameList?type=recommend', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  272. ],
  273. '[news]' => [
  274. ':id' => ['Mobile/News/detail', ['method' => 'get', 'domain' => MOBILE_WEBSITE_DOMAIN], ['id' => '\d+']],
  275. ],
  276. '[news/index]' => [
  277. '[:0]' => ['Mobile/news/index?type=1', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  278. ],
  279. '[news/xyzx]' => [
  280. '[:0]' => ['Mobile/news/index?type=1', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  281. ],
  282. '[news/lyzx]' => [
  283. '[:0]' => ['Mobile/news/index?type=2', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  284. ],
  285. '[news/xypc]' => [
  286. '[:0]' => ['Mobile/news/index?type=3', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  287. ],
  288. '[news/xygl]' => [
  289. '[:0]' => ['Mobile/news/index?type=4', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  290. ],
  291. '[news/jcsp]' => [
  292. '[:0]' => ['Mobile/news/index?type=5', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  293. ],
  294. 'kf' => ['Mobile/service/index', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  295. 'kc' => ['Mobile/service/kc', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  296. 'search/keyword/:keyword' => ['Mobile/search/search', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  297. 'syxy' => ['Mobile/index/agreement', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  298. 'kefu' => ['Mobile/csc/index', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  299. 'kefu/zhss' => ['Mobile/csc/appeal', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  300. 'kefu/sscx' => ['Mobile/csc/appealResult', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  301. 'kefu/wxss' => ['Mobile/csc/wechatAppeal', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  302. 'kefu/zhss/check' => ['Mobile/csc/check', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  303. 'kefu/zhss/user' => ['Mobile/csc/appealAccount', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  304. 'kefu/zhss/history' => ['Mobile/csc/appealHistory', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  305. 'kefu/zhss/result' => ['Mobile/csc/appealEnding', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  306. '[gift/index]' => [
  307. '[:0]' => ['Mobile/gift/index', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  308. ],
  309. '[gift/new]' => [
  310. '[:0]' => ['Mobile/gift/news', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  311. ],
  312. '[gift/hot]' => [
  313. '[:0]' => ['Mobile/gift/index', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  314. ],
  315. '[gift]' => [
  316. ':id' => ['Mobile/gift/detail', ['method' => 'get', 'domain' => MOBILE_WEBSITE_DOMAIN], ['id' => '\d+']],
  317. ],
  318. '[fastgame]' => [
  319. '[:0]' => ['Mobile/gameaid/index', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  320. ],
  321. '[login]' => [
  322. '[:0]' => ['Mobile/member/login', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  323. ],
  324. '[register]' => [
  325. '[:0]' => ['Mobile/member/userReg', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  326. ],
  327. 'forgotpwd' => ['Mobile/member/contactAccount', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  328. 'forgotpwd/check' => ['Mobile/member/contactWay', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  329. 'forgotpwd/check/email' => ['Mobile/member/contact?type=email', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  330. 'forgotpwd/check/mobile' => ['Mobile/member/contact?type=phone', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  331. 'forgotpwd/resetpwd' => ['Mobile/member/forgetPwdToReset', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  332. 'user' => ['Mobile/member/personalCenter', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  333. 'user/userinfo' => ['Mobile/member/personalInfo', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  334. 'user/userinfo/qq' => ['Mobile/member/editqq', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  335. 'user/userinfo/code' => ['Mobile/member/editzipcode', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  336. 'user/userinfo/address' => ['Mobile/member/editaddress', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  337. '[user/rechargeinfo]' => [
  338. '[:status]' => ['Mobile/member/personalPay', ['domain' => MOBILE_WEBSITE_DOMAIN]]
  339. ],
  340. 'user/giftbox' => ['Mobile/member/giftbox', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  341. 'user/giftbox/gq' => ['Mobile/member/giftboxgp', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  342. '[kefu/cjwt]' => [
  343. '[:type]' => ['Mobile/csc/question', ['domain' => MOBILE_WEBSITE_DOMAIN]]
  344. ],
  345. 'kefu/sscx/result' => ['Mobile/csc/appealResultPage', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  346. 'kefu/sscx/resetpwd' => ['Mobile/csc/resetPwdPage', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  347. 'user/zhaq' => ['Mobile/member/personalAccount', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  348. 'user/zhaq/changepwd' => ['Mobile/member/personalChangePwd', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  349. 'user/zhaq/realname' => ['Mobile/member/personalIdentityPage', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  350. 'gzgzh' => ['Mobile/csc/subscription', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  351. 'user/userinfo/nickname' => ['Mobile/member/editnickname', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  352. 'feedback' => ['Mobile/member/feedback', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  353. 'user/mygame' => ['Mobile/member/mygame', ['domain' => MOBILE_WEBSITE_DOMAIN]],
  354. ];
  355. $routeSetting = array_merge($routeSetting, $routeMobile);
  356. }
  357. // ## 以下注释,后续项目推广页没有发现问题,可以删除
  358. // //短链接域名时
  359. // if(isset($_SERVER['HTTP_HOST']) && !isset($_GET['cid']) && ('http://'.$_SERVER['HTTP_HOST']==API_DOMAIN || 'https://'.$_SERVER['HTTP_HOST']==API_DOMAIN || 'http://'.$_SERVER['HTTP_HOST']==API_DOMAIN.':80' || 'https://'.$_SERVER['HTTP_HOST']==API_DOMAIN.':80' || 'http://'.$_SERVER['HTTP_HOST'] == T_DOMAIN || 'http://'.$_SERVER['HTTP_HOST']==T_DOMAIN.':80' || 'http://'.$_SERVER['SERVER_NAME']==T_DOMAIN || 'https://'.$_SERVER['SERVER_NAME']==T_DOMAIN || 'https://'.$_SERVER['SERVER_NAME']==T_DOMAIN.':80' || 'https://'.$_SERVER['SERVER_NAME']==T_DOMAIN.':67')){
  360. //
  361. // $short_link = pathinfo($_SERVER['REQUEST_URI'])['filename'];
  362. // if(strpos($short_link,'?')){
  363. // $short_link = substr($short_link,0,strpos($short_link,'?'));
  364. // }
  365. //
  366. // $arrAlias = db('nw_promotion_short_link')->where(['short_link'=>$short_link])->column('short_link,id');
  367. // if(!empty($arrAlias)){
  368. // foreach ($arrAlias as $key => $value){
  369. // $arrAlias[$key] = 'api/game_promotion/index';
  370. // }
  371. // }
  372. // else{
  373. // $arrAlias = [];
  374. // }
  375. //
  376. // $routeSetting['__alias__'] = $arrAlias;
  377. //
  378. // }
  379. // // 推广短链
  380. // if (isset($_SERVER['HTTP_HOST']) || (strpos($_SERVER['HTTP_HOST'], T_DOMAIN_URL) !== false || strpos($_SERVER['SERVER_NAME'], T_DOMAIN_URL) !== false)) {
  381. // $short_link = pathinfo($_SERVER['REQUEST_URI'])['filename'];
  382. // if (strpos($short_link, '?')) {
  383. // $short_link = substr($short_link, 0, strpos($short_link, '?'));
  384. // }
  385. //
  386. // if ($short_link != 'index') {
  387. // $arrAlias = db('nw_promotion_short_link')->where(['short_link' => $short_link])->column('short_link,id');
  388. // if (!empty($arrAlias)) {
  389. // foreach ($arrAlias as $key => $value) {
  390. // $arrAlias[(string)$key] = 'api/game_promotion/index';
  391. // }
  392. // } else {
  393. // $arrAlias = [];
  394. // }
  395. //
  396. // $routeSetting['__alias__'] = $arrAlias;
  397. // // dump($routeSetting);
  398. // }
  399. // }
  400. //
  401. // // 推广页
  402. // if (pathinfo($_SERVER['REQUEST_URI'])['dirname'] == '/tgy') {
  403. // $short_link = pathinfo($_SERVER['REQUEST_URI'])['filename'];
  404. // $arrAlias = db('nw_promotion_short_link')->where(['short_link' => $short_link])->field('short_link,channel_id')->find();
  405. // // dump($arrAlias);
  406. // if ($arrAlias) {
  407. // $routeSetting['[tgy/:cid]'] = [
  408. // '[:0]' => ['api/game/index?cid=' . base64_encode(auth_code($arrAlias['channel_id'], "ENCODE", Env::get('auth_key')))],
  409. // ];
  410. // }
  411. // }
  412. return $routeSetting;