785 lines
37 KiB
PHP
Executable File
785 lines
37 KiB
PHP
Executable File
<?php
|
|
|
|
use think\Route;
|
|
use think\Config;
|
|
use think\Request;
|
|
|
|
function url_rewrite($type, $array = [], $baseurl = '') {
|
|
if (!isset($array['id'])) {
|
|
$array['id'] = '0';
|
|
}
|
|
switch ($type) {
|
|
case 'index':
|
|
$return = $baseurl.'/index.html';
|
|
break;
|
|
case 'product':
|
|
if (empty($array['id'])) {
|
|
$return = $baseurl.'/product.html';
|
|
} else {
|
|
$return = $baseurl.'/product/category/'.$array['id'].'.html';
|
|
}
|
|
break;
|
|
case 'productsub':
|
|
$return = $baseurl.'/product/subcategory/'.$array['id'].'.html';
|
|
break;
|
|
|
|
case 'productdetail':
|
|
if (empty($array['color'])) {
|
|
$return = $baseurl.'/product/detail/'.$array['id'].'.html';
|
|
} else {
|
|
$return = $baseurl.'/product/detail/'.$array['id'].'/'.$array['color'].'.html';
|
|
}
|
|
break;
|
|
case 'article':
|
|
if (empty($array['id'])) {
|
|
$return = $baseurl.'/article.html';
|
|
} else {
|
|
$return = $baseurl.'/article/category/'.$array['id'].'.html';
|
|
}
|
|
break;
|
|
case 'mobile/article':
|
|
if (empty($array['id'])) {
|
|
$return = $baseurl.'mobile/article.html';
|
|
} else {
|
|
$return = $baseurl.'/article/category/'.$array['id'].'.html';
|
|
}
|
|
break;
|
|
case 'articledetail':
|
|
$return = $baseurl.'/article/detail/'.$array['id'].'.html';
|
|
break;
|
|
|
|
case 'blog':
|
|
$return = $baseurl.'/index/blog.html';
|
|
break;
|
|
case 'blogdetail':
|
|
$return = $baseurl.'/index/blog/detail/'.$array['id'].
|
|
'.html';
|
|
break;
|
|
case 'new_arrival':
|
|
$return = $baseurl.'/index/product/new_arrival.html';
|
|
break;
|
|
case 'index/product/new_arrival':
|
|
$return = $baseurl. '/index/product/new_arrival.html';
|
|
break;
|
|
|
|
case 'voicedetail':
|
|
$return = $baseurl.'/voice/detail/'.$array['id']. '.html';
|
|
break;
|
|
case 'video':
|
|
$return = $baseurl.'/video.html';
|
|
break;
|
|
case 'videodetail':
|
|
$return = $baseurl.'/video/detail/'.$array['id'].'.html';
|
|
|
|
break;
|
|
case 'new_arrival':
|
|
$return = $baseurl.'/product/new_arrival.html';
|
|
|
|
break;
|
|
case 'download':
|
|
if (empty($array['id'])) {
|
|
$return = $baseurl. '/download.html';
|
|
} else {
|
|
$return = $baseurl.'/download/category/'.$array['id'].'.html';
|
|
}
|
|
break;
|
|
case 'mobile/download':
|
|
if (empty($array['id'])) {
|
|
$return = $baseurl.'mobile/download.html';
|
|
} else {
|
|
$return = $baseurl.'mobile/download/category/'.$array['id']. '.html';
|
|
}
|
|
break;
|
|
case 'dlsearch':
|
|
if (empty($array['id'])) {
|
|
$return = $baseurl.'/download.html';
|
|
} else {
|
|
$return = $baseurl.'/download/dlsearch/'.$array['id']. '.html';
|
|
}
|
|
break;
|
|
case 'index/customer/logout':
|
|
|
|
//$return = 'logout$' => ['index/customer/logout', ['ext' => 'html']],
|
|
$return = $baseurl. 'index/customer/logout.html';
|
|
break;
|
|
case 'downloaddetail':
|
|
$return = $baseurl.'/download/detail/'.$array['id'].'.html';
|
|
break;
|
|
case 'singlepage':
|
|
$route_rules = (array) Config::get('single_route_rules');
|
|
if (isset($route_rules[$array['id']])) {
|
|
$return = $baseurl.'/'.$route_rules[$array['id']]. '.html';
|
|
} else {
|
|
$return = $baseurl.'/singlepage/'.$array['id']. '.html';
|
|
}
|
|
break;
|
|
case 'externallink':
|
|
if (isset($array['link'])) {
|
|
$return = $array['link'];
|
|
} else {
|
|
$return = '#';
|
|
}
|
|
break;
|
|
|
|
|
|
|
|
//美国路由
|
|
case 'us':
|
|
$return = $baseurl.'us/index.html';
|
|
break;
|
|
case 'us/agents':
|
|
$return = $baseurl.'us/agents.html';
|
|
break;
|
|
case 'us/blog':
|
|
$return = $baseurl.'us/blog.html';
|
|
break;
|
|
case 'us/blogdetail':
|
|
$return = $baseurl. 'us/blog/detail/'.$array['id'].'.html';
|
|
break;
|
|
case 'us/video':
|
|
if (empty($array['id'])) {
|
|
$return = $baseurl. 'us/video.html';
|
|
} else {
|
|
$return = $baseurl. 'us/video/category/'.$array['id']. '.html';
|
|
}
|
|
break;
|
|
case 'us/videodetail':
|
|
$return = $baseurl. 'us/video/detail/'.$array['id'].'.html';
|
|
break;
|
|
case 'us/download':
|
|
if (empty($array['id'])) {
|
|
$return = $baseurl. 'us/download.html';
|
|
} else {
|
|
$return = $baseurl. 'us/download/category/'.$array['id'].'.html';
|
|
}
|
|
break;
|
|
case 'us/downloaddetail':
|
|
$return = $baseurl. 'us/download/detail/'.$array['id'].'.html';
|
|
break;
|
|
case 'us/singlepage':
|
|
$route_rules = (array) Config::get('single_route_rules');
|
|
if (isset($route_rules[$array['id']])) {
|
|
$return = $baseurl. '/'.$route_rules[$array['id']].'.html';
|
|
} else {
|
|
$return = $baseurl.'us/singlepage/'.$array['id'].'.html';
|
|
}
|
|
break;
|
|
case 'us/externallink':
|
|
if (isset($array['link'])) {
|
|
$return = $array['link'];
|
|
} else {
|
|
$return = '#';
|
|
}
|
|
break;
|
|
case 'us/articledetail':
|
|
$return = $baseurl.'us/article/detail/'.$array['id'].'.html';
|
|
break;
|
|
case 'us/voicedetail':
|
|
$return = $baseurl. 'us/voice/detail/'.$array['id']. '.html';
|
|
break;
|
|
case 'us/product':
|
|
if (empty($array['id'])) {
|
|
// $return = $baseurl . 'uk/product.html';
|
|
$return = $baseurl. 'us/product.html';
|
|
} else {
|
|
// $return = $baseurl . 'product/category/' . $array['id'] . '.html';
|
|
$return = $baseurl. 'us/product/category/'.$array['id']. '.html';
|
|
}
|
|
break;
|
|
case 'us/productsub':
|
|
$return = $baseurl. 'us/product/subcategory/'.$array['id'].
|
|
'.html';
|
|
break;
|
|
case 'us/productdetail':
|
|
if (empty($array['color'])) {
|
|
$return = $baseurl. 'us/product/detail/'.$array['id']. '.html';
|
|
} else {
|
|
$return = $baseurl. 'us/product/detail/'.$array['id']. '/'.$array['color'].'.html';
|
|
}
|
|
break;
|
|
case 'usmobile/article':
|
|
if (empty($array['id'])) {
|
|
$return = $baseurl.'usmobile/article.html';
|
|
} else {
|
|
$return = $baseurl.'usmobile/article/category/'.$array['id'].'.html';
|
|
}
|
|
break;
|
|
case 'us/article':
|
|
if (empty($array['id'])) {
|
|
$return = $baseurl. 'us/article.html';
|
|
} else {
|
|
$return = $baseurl. 'us/article/category/'.$array['id'].'.html';
|
|
}
|
|
break;
|
|
|
|
|
|
|
|
//印尼路由
|
|
case 'id':
|
|
$return = $baseurl.'id/index.html';
|
|
break;
|
|
case 'id/video':
|
|
if (empty($array ['id'])) {
|
|
$return = 'http://www.orico.cc/id/video.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/id/video/category/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
case 'id/videodetail':
|
|
$return = 'http://www.orico.cc/id/video/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'id/download' :
|
|
if (empty($array['id'])) {
|
|
$return = 'http://www.orico.cc/id/download.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/id/download/category/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
case 'id/downloaddetail' :
|
|
$return = 'http://www.orico.cc/id/download/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'id/singlepage':
|
|
$route_rules = (array) Config::get('single_route_rules');
|
|
if (isset($route_rules[$array['id']])) {
|
|
$return = $baseurl . '/' . $route_rules[$array['id']] . '.html';
|
|
} else {
|
|
$return = $baseurl . 'http://www.orico.cc/id/singlepage/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
case 'id/externallink':
|
|
if (isset($array['link'])) {
|
|
$return = $array['link'];
|
|
} else {
|
|
$return = '#';
|
|
}
|
|
break;
|
|
case 'id/articledetail':
|
|
$return = $baseurl . 'id/article/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'id/voicedetail' :
|
|
$return = $baseurl . 'id/voice/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'id/product':
|
|
if (empty($array['id'])) {
|
|
// $return = $baseurl . 'uk/product.html';
|
|
$return = 'http://www.orico.cc/id/product.html';
|
|
} else {
|
|
// $return = $baseurl . 'product/category/' . $array['id'] . '.html';
|
|
$return = 'http://www.orico.cc/id/product/category/' . $array['id'].'.html';
|
|
}
|
|
break;
|
|
case 'id/productsub' :
|
|
$return = 'http://www.orico.cc/id/product/subcategory/' . $array['id'] . '.html';
|
|
break;
|
|
case 'id/productdetail' :
|
|
if (empty($array['color'])) {
|
|
$return = 'http://www.orico.cc/id/product/detail/' . $array['id'] . '.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/id/product/detail/' . $array['id'] . '/' . $array['color'] . '.html';
|
|
}
|
|
break;
|
|
case 'id/article':
|
|
if (empty($array['id'])) {
|
|
$return = 'http://www.orico.cc/id/article.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/id/article/category/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
//泰国路由
|
|
case 'th':
|
|
$return = $baseurl.'th/index.html';
|
|
break;
|
|
case 'th/video':
|
|
if (empty($array ['id'])) {
|
|
$return = 'http://www.orico.cc/th/video.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/th/video/category/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
case 'th/videodetail':
|
|
$return = 'http://www.orico.cc/th/video/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'th/download' :
|
|
if (empty($array['id'])) {
|
|
$return = 'http://www.orico.cc/th/download.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/th/download/category/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
case 'th/downloaddetail' :
|
|
$return = 'http://www.orico.cc/th/download/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'th/singlepage':
|
|
$route_rules = (array) Config::get('single_route_rules');
|
|
if (isset($route_rules[$array['id']])) {
|
|
$return = $baseurl . '/' . $route_rules[$array['id']] . '.html';
|
|
} else {
|
|
$return = $baseurl . 'http://www.orico.cc/th/singlepage/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
case 'th/externallink':
|
|
if (isset($array['link'])) {
|
|
$return = $array['link'];
|
|
} else {
|
|
$return = '#';
|
|
}
|
|
break;
|
|
case 'th/articledetail':
|
|
$return = $baseurl . 'th/article/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'th/voicedetail' :
|
|
$return = $baseurl . 'th/voice/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'th/product':
|
|
if (empty($array['id'])) {
|
|
// $return = $baseurl . 'uk/product.html';
|
|
$return = 'http://www.orico.cc/th/product.html';
|
|
} else {
|
|
// $return = $baseurl . 'product/category/' . $array['id'] . '.html';
|
|
$return = 'http://www.orico.cc/th/product/category/' . $array['id'].'.html';
|
|
}
|
|
break;
|
|
case 'th/productsub' :
|
|
$return = 'http://www.orico.cc/th/product/subcategory/' . $array['id'] . '.html';
|
|
break;
|
|
case 'th/productdetail' :
|
|
if (empty($array['color'])) {
|
|
$return = 'http://www.orico.cc/th/product/detail/' . $array['id'] . '.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/th/product/detail/' . $array['id'] . '/' . $array['color'] . '.html';
|
|
}
|
|
break;
|
|
case 'th/article':
|
|
if (empty($array['id'])) {
|
|
$return = 'http://www.orico.cc/th/article.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/th/article/category/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
//越南路由
|
|
case 'vn':
|
|
$return = $baseurl.'vn/index.html';
|
|
break;
|
|
case 'vn/video':
|
|
if (empty($array ['id'])) {
|
|
$return = 'http://www.orico.cc/vn/video.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/vn/video/category/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
case 'vn/videodetail':
|
|
$return = 'http://www.orico.cc/vn/video/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'vn/download' :
|
|
if (empty($array['id'])) {
|
|
$return = 'http://www.orico.cc/vn/download.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/vn/download/category/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
case 'vn/downloaddetail' :
|
|
$return = 'http://www.orico.cc/vn/download/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'vn/singlepage':
|
|
$route_rules = (array) Config::get('single_route_rules');
|
|
if (isset($route_rules[$array['id']])) {
|
|
$return = $baseurl . '/' . $route_rules[$array['id']] . '.html';
|
|
} else {
|
|
$return = $baseurl . 'http://www.orico.cc/vn/singlepage/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
case 'vn/externallink':
|
|
if (isset($array['link'])) {
|
|
$return = $array['link'];
|
|
} else {
|
|
$return = '#';
|
|
}
|
|
break;
|
|
case 'vn/articledetail':
|
|
$return = $baseurl . 'vn/article/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'vn/voicedetail' :
|
|
$return = $baseurl . 'vn/voice/detail/' . $array['id'] . '.html';
|
|
break;
|
|
case 'vn/product':
|
|
if (empty($array['id'])) {
|
|
// $return = $baseurl . 'uk/product.html';
|
|
$return = 'http://www.orico.cc/vn/product.html';
|
|
} else {
|
|
// $return = $baseurl . 'product/category/' . $array['id'] . '.html';
|
|
$return = 'http://www.orico.cc/vn/product/category/' . $array['id'].'.html';
|
|
}
|
|
break;
|
|
case 'vn/productsub' :
|
|
$return = 'http://www.orico.cc/vn/product/subcategory/' . $array['id'] . '.html';
|
|
break;
|
|
case 'vn/productdetail' :
|
|
if (empty($array['color'])) {
|
|
$return = 'http://www.orico.cc/vn/product/detail/' . $array['id'] . '.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/vn/product/detail/' . $array['id'] . '/' . $array['color'] . '.html';
|
|
}
|
|
break;
|
|
case 'vn/article':
|
|
if (empty($array['id'])) {
|
|
$return = 'http://www.orico.cc/vn/article.html';
|
|
} else {
|
|
$return = 'http://www.orico.cc/vn/article/category/' . $array['id'] . '.html';
|
|
}
|
|
break;
|
|
default:
|
|
$return = '#';
|
|
break;
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
Route::get('profilesql', function() {
|
|
echo 'success';
|
|
});
|
|
$route_rules = (array) Config::get('single_route_rules');
|
|
foreach ($route_rules as $key => $value) {
|
|
Route::rule($value, 'index/singlepage/detail?id=' . $key . '&view=' . $value, 'get', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']);
|
|
}
|
|
Route::group('product', [
|
|
'detail/:id/[:color]' => ['index/product/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'color' => '[0-9a-zA-Z_-]+']],
|
|
'category/:id' => ['index/product/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'subcategory/:id' => ['index/product/subcatelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['index/product/lists', ['ext' => 'html']],
|
|
]);
|
|
Route::group('article', [
|
|
'detail/:id' => ['index/article/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['index/article/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['index/article/catelists?id=1', ['ext' => 'html']],
|
|
]);
|
|
Route::group('video', [
|
|
'detail/:id' => ['index/video/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['index/video/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['index/video/lists', ['ext' => 'html']],
|
|
]);
|
|
|
|
Route::group('download', [
|
|
'detail/:id' => ['index/download/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['index/download/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'dlsearch/:id' => ['index/download/dlsearch', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['index/download/catelists?id=1', ['ext' => 'html']],
|
|
]);
|
|
|
|
|
|
|
|
//中文移动端路由 Martin 2023-12-28 Update
|
|
Route::group('mobile/article', [
|
|
'detail/:id' => ['mobile/article/detail', ['method' => 'get', 'ext' => 'html'],
|
|
['id' => '\d+']
|
|
],
|
|
'category/:id' => ['mobile/article/catelists', ['method' => 'get', 'ext' => 'html'],
|
|
['id' => '\d+']
|
|
],
|
|
'/$' => ['mobile/article/lists', ['ext' => 'html']],
|
|
]);
|
|
Route::group('usmobile/article', [
|
|
'detail/:id' => ['usmobile/article/detail', ['method' => 'get', 'ext' => 'html'],
|
|
['id' => '\d+']
|
|
],
|
|
'/$' => ['usmobile/article/lists?id=16', ['ext' => 'html']],
|
|
]);
|
|
Route::group('mobile/product', [
|
|
'new_arrival/' => ['index/product/new_arrival', ['ext' => 'html']],
|
|
'/$' => ['mobile/product/lists', ['ext' => 'html']],
|
|
]);
|
|
Route::group('usmobile/download', [
|
|
'detail/:id' => ['usmobile/download/detail', ['method' => 'get', 'ext' => 'html'],
|
|
['id' => '\d+']
|
|
],
|
|
'dlsearch/:id' => ['usmobile/download/dlsearch', ['method' => 'get', 'ext' => 'html'],
|
|
['id' => '\d+']
|
|
],
|
|
'/$' => ['usmobile/download/catelists?id=22', ['ext' => 'html']],
|
|
]);
|
|
Route::group('usmobile/article', [
|
|
'detail/:id' => ['usmobile/article/detail', ['method' => 'get', 'ext' => 'html'],
|
|
['id' => '\d+']
|
|
],
|
|
'category/:id' => ['usmobile/article/catelists', ['method' => 'get', 'ext' => 'html'],
|
|
['id' => '\d+']
|
|
],
|
|
'/$' => ['usmobile/article/catelists?id=16', ['ext' => 'html']],
|
|
]);
|
|
Route::group('mobile/download', [
|
|
'detail/:id' => ['mobile/download/detail', ['method' => 'get', 'ext' => 'html'],
|
|
['id' => '\d+']
|
|
],
|
|
'category/:id' => ['mobile/download/catelists', ['method' => 'get', 'ext' => 'html'],
|
|
['id' => '\d+']
|
|
],
|
|
'dlsearch/:id' => ['mobile/download/dlsearch', ['method' => 'get', 'ext' => 'html'],
|
|
['id' => '\d+']
|
|
],
|
|
'/$' => ['mobile/download/catelists?id=1', ['ext' => 'html']],
|
|
]);
|
|
|
|
|
|
|
|
//英国路由
|
|
Route::group('uk/download', [
|
|
'detail/:id' => ['uk/download/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['uk/download/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'$' => ['uk/download/catelists?id=1', ['ext' => 'html']],
|
|
]);
|
|
Route::group('uk/article', [
|
|
'detail/:id' => ['uk/article/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['uk/article/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['uk/article/catelists?id=1', ['ext' => 'html']],
|
|
]);
|
|
Route::group('uk/video', [
|
|
'detail/:id' => ['uk/video/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['uk/video/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['uk/video/lists', ['ext' => 'html']],
|
|
]);
|
|
Route::group('uk/product', [
|
|
'detail/:id/[:color]' => ['uk/product/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'color' => '[0-9a-zA-Z_-]+']],
|
|
'category/:id' => ['uk/product/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'subcategory/:id' => ['uk/product/subcatelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['uk/product/lists', ['ext' => 'html']],
|
|
]);
|
|
//美国路由
|
|
Route::group('us/download', [
|
|
'detail/:id' => ['us/download/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['us/download/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'$' => ['us/download/catelists?id=1', ['ext' => 'html']],
|
|
]);
|
|
Route::group('us/article', [
|
|
'detail/:id' => ['us/article/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['us/article/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['us/article/catelists?id=16', ['ext' => 'html']],
|
|
]);
|
|
Route::group('us/video', [
|
|
'detail/:id' => ['us/video/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['us/video/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['us/video/lists', ['ext' => 'html']],
|
|
]);
|
|
Route::group('us/product', [
|
|
'detail/:id/[:color]' => ['us/product/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'color' => '[0-9a-zA-Z_-]+']],
|
|
'category/:id' => ['us/product/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'subcategory/:id' => ['us/product/subcatelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'new_arrival/' => ['index/product/new_arrival', ['ext' => 'html']],
|
|
'/$' => ['us/product/lists', ['ext' => 'html']],
|
|
]);
|
|
//印尼路由
|
|
Route::group('id/download', [
|
|
'detail/:id' => ['id/download/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['id/download/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'$' => ['id/download/catelists?id=8', ['ext' => 'html']],
|
|
]);
|
|
Route::group('id/article', [
|
|
'detail/:id' => ['id/article/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['id/article/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['id/article/catelists?id=21', ['ext' => 'html']],
|
|
]);
|
|
Route::group('id/video', [
|
|
'detail/:id' => ['id/video/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['id/video/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['id/video/lists', ['ext' => 'html']],
|
|
]);
|
|
Route::group('id/product', [
|
|
'detail/:id/[:color]' => ['id/product/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'color' => '[0-9a-zA-Z_-]+']],
|
|
'category/:id' => ['id/product/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'subcategory/:id' => ['id/product/subcatelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['id/product/lists', ['ext' => 'html']],
|
|
]);
|
|
//泰国路由
|
|
Route::group('th/download', [
|
|
'detail/:id' => ['th/download/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['th/download/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'$' => ['th/download/catelists?id=15', ['ext' => 'html']],
|
|
]);
|
|
Route::group('th/article', [
|
|
'detail/:id' => ['th/article/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['th/article/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['th/article/catelists?id=16', ['ext' => 'html']],
|
|
]);
|
|
Route::group('th/video', [
|
|
'detail/:id' => ['th/video/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['th/video/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['th/video/lists', ['ext' => 'html']],
|
|
]);
|
|
Route::group('th/product', [
|
|
'detail/:id/[:color]' => ['th/product/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'color' => '[0-9a-zA-Z_-]+']],
|
|
'category/:id' => ['th/product/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'subcategory/:id' => ['th/product/subcatelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['th/product/lists', ['ext' => 'html']],
|
|
]);
|
|
//越南路由
|
|
Route::group('vn/download', [
|
|
'detail/:id' => ['vn/download/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['vn/download/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'$' => ['vn/download/catelists?id=29', ['ext' => 'html']],
|
|
]);
|
|
Route::group('vn/article', [
|
|
'detail/:id' => ['vn/article/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['vn/article/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['vn/article/catelists?id=6', ['ext' => 'html']],
|
|
]);
|
|
Route::group('vn/video', [
|
|
'detail/:id' => ['vn/video/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'category/:id' => ['vn/video/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['vn/video/lists', ['ext' => 'html']],
|
|
]);
|
|
Route::group('vn/product', [
|
|
'detail/:id/[:color]' => ['vn/product/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'color' => '[0-9a-zA-Z_-]+']],
|
|
'category/:id' => ['vn/product/catelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'subcategory/:id' => ['vn/product/subcatelists', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'/$' => ['vn/product/lists', ['ext' => 'html']],
|
|
]);
|
|
|
|
// Kafka生产
|
|
Route::group('kafkaproducer', function() {
|
|
Route::post('send', 'KafkaProducer/send');
|
|
});
|
|
// Kafka消费
|
|
Route::group('kafkaconsumer', function() {
|
|
Route::post('consumer', 'KafkaConsumer/consumer');
|
|
});
|
|
|
|
// 接收产品目录同步数据
|
|
Route::group('receive_sync', function () {
|
|
Route::post('category', 'admin/ReceiveSync/category');
|
|
Route::post('product', 'admin/ReceiveSync/product');
|
|
});
|
|
|
|
|
|
Route::rule([
|
|
'ad_js/:id' => ['index/ad/index', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'ad_tp/:id' => ['index/ad/adtp', ['method' => 'get', 'ext' => 'html'], ['id' => '[0-9a-zA-Z_-]+']],
|
|
'ad_tag/:tags/[:num]' => ['index/ad/tags', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'ad_tagli/:tags/[:num]' => ['index/ad/tagsli', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'ad_cat/:id/[:num]' => ['index/ad/cat', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'num' => '\d+']],
|
|
'singlepage/:id' => ['index/singlepage/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'search$' => ['index/search/index', ['ext' => 'html']],
|
|
'dlsearch$' => ['index/download/search?id=1', ['ext' => 'html']],
|
|
'dl/:id/[:bit]$' => ['index/download/download', ['ext' => 'html'], ['id' => '\d+', 'bit' => '[0-9]+']],
|
|
'prodl/:id$' => ['index/download/prodownload', ['ext' => 'html'], ['id' => '\d+']],
|
|
'pinglunadd$' => ['index/pinglun/add', ['method' => 'post'], ['id' => '\d+']],
|
|
'pinglun/[:type]/[:cid]$' => ['index/pinglun/lists', [], ['type' => '[0-9a-zA-Z_-]+', 'cid' => '\d+']],
|
|
//英国
|
|
'uk/ad_js/:id' => ['uk/ad/index', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'uk/ad_tp/:id' => ['uk/ad/adtp', ['method' => 'get', 'ext' => 'html'], ['id' => '[0-9a-zA-Z_-]+']],
|
|
'uk/ad_tag/:tags/[:num]' => ['uk/ad/tags', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'uk/ad_tagli/:tags/[:num]' => ['uk/ad/tagsli', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'uk/ad_cat/:id/[:num]' => ['uk/ad/cat', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'num' => '\d+']],
|
|
'uk/singlepage/:id' => ['uk/singlepage/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'uk/search$' => ['uk/search/index', ['ext' => 'html']],
|
|
'uk/dlsearch$' => ['uk/download/search?id=1', ['ext' => 'html']],
|
|
'uk/dl/:id/[:bit]$' => ['uk/download/download', ['ext' => 'html'], ['id' => '\d+', 'bit' => '[0-9]+']],
|
|
'uk/prodl/:id$' => ['uk/download/prodownload', ['ext' => 'html'], ['id' => '\d+']],
|
|
'uk/pinglunadd$' => ['uk/pinglun/add', ['method' => 'post'], ['id' => '\d+']],
|
|
'uk/pinglun/[:type]/[:cid]$' => ['uk/pinglun/lists', [], ['type' => '[0-9a-zA-Z_-]+', 'cid' => '\d+']],
|
|
//美国
|
|
'us/ad_js/:id' => ['us/ad/index', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'us/ad_tp/:id' => ['us/ad/adtp', ['method' => 'get', 'ext' => 'html'], ['id' => '[0-9a-zA-Z_-]+']],
|
|
'us/ad_tag/:tags/[:num]' => ['us/ad/tags', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'us/ad_tagli/:tags/[:num]' => ['us/ad/tagsli', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'us/ad_cat/:id/[:num]' => ['us/ad/cat', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'num' => '\d+']],
|
|
'us/singlepage/:id' => ['us/singlepage/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'us/search$' => ['us/search/index', ['ext' => 'html']],
|
|
'us/dlsearch$' => ['us/download/search?id=1', ['ext' => 'html']],
|
|
'us/dl/:id/[:bit]$' => ['us/download/download', ['ext' => 'html'], ['id' => '\d+', 'bit' => '[0-9]+']],
|
|
'us/prodl/:id$' => ['us/download/prodownload', ['ext' => 'html'], ['id' => '\d+']],
|
|
'us/pinglunadd$' => ['us/pinglun/add', ['method' => 'post'], ['id' => '\d+']],
|
|
'us/pinglun/[:type]/[:cid]$' => ['us/pinglun/lists', [], ['type' => '[0-9a-zA-Z_-]+', 'cid' => '\d+']],
|
|
'us/email' => ['us/email/index', ['method' => 'post'], ['id' => '\d+']],
|
|
//印尼
|
|
'id/ad_js/:id' => ['id/ad/index', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'id/ad_tp/:id' => ['id/ad/adtp', ['method' => 'get', 'ext' => 'html'], ['id' => '[0-9a-zA-Z_-]+']],
|
|
'id/ad_tag/:tags/[:num]' => ['id/ad/tags', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'id/ad_tagli/:tags/[:num]' => ['id/ad/tagsli', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'id/ad_cat/:id/[:num]' => ['id/ad/cat', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'num' => '\d+']],
|
|
'id/singlepage/:id' => ['id/singlepage/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'id/search$' => ['id/search/index', ['ext' => 'html']],
|
|
'id/dlsearch$' => ['id/download/search?id=8', ['ext' => 'html']],
|
|
'id/dl/:id/[:bit]$' => ['id/download/download', ['ext' => 'html'], ['id' => '\d+', 'bit' => '[0-9]+']],
|
|
'id/prodl/:id$' => ['id/download/prodownload', ['ext' => 'html'], ['id' => '\d+']],
|
|
'id/pinglunadd$' => ['id/pinglun/add', ['method' => 'post'], ['id' => '\d+']],
|
|
'id/pinglun/[:type]/[:cid]$' => ['id/pinglun/lists', [], ['type' => '[0-9a-zA-Z_-]+', 'cid' => '\d+']],
|
|
//越南
|
|
'th/ad_js/:id' => ['th/ad/index', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'th/ad_tp/:id' => ['th/ad/adtp', ['method' => 'get', 'ext' => 'html'], ['id' => '[0-9a-zA-Z_-]+']],
|
|
'th/ad_tag/:tags/[:num]' => ['th/ad/tags', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'th/ad_tagli/:tags/[:num]' => ['th/ad/tagsli', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'th/ad_cat/:id/[:num]' => ['th/ad/cat', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'num' => '\d+']],
|
|
'th/singlepage/:id' => ['th/singlepage/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'th/search$' => ['th/search/index', ['ext' => 'html']],
|
|
'th/dlsearch$' => ['th/download/search?id=1', ['ext' => 'html']],
|
|
'th/dl/:id/[:bit]$' => ['th/download/download', ['ext' => 'html'], ['id' => '\d+', 'bit' => '[0-9]+']],
|
|
'th/prodl/:id$' => ['th/download/prodownload', ['ext' => 'html'], ['id' => '\d+']],
|
|
'th/pinglunadd$' => ['th/pinglun/add', ['method' => 'post'], ['id' => '\d+']],
|
|
'th/pinglun/[:type]/[:cid]$' => ['th/pinglun/lists', [], ['type' => '[0-9a-zA-Z_-]+', 'cid' => '\d+']],
|
|
//泰国
|
|
'vn/ad_js/:id' => ['vn/ad/index', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'vn/ad_tp/:id' => ['vn/ad/adtp', ['method' => 'get', 'ext' => 'html'], ['id' => '[0-9a-zA-Z_-]+']],
|
|
'vn/ad_tag/:tags/[:num]' => ['vn/ad/tags', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'vn/ad_tagli/:tags/[:num]' => ['vn/ad/tagsli', ['method' => 'get', 'ext' => 'html'], ['tags' => '[0-9a-zA-Z_-]+', 'num' => '\d+']],
|
|
'vn/ad_cat/:id/[:num]' => ['vn/ad/cat', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+', 'num' => '\d+']],
|
|
'vn/singlepage/:id' => ['vn/singlepage/detail', ['method' => 'get', 'ext' => 'html'], ['id' => '\d+']],
|
|
'vn/search$' => ['vn/search/index', ['ext' => 'html']],
|
|
'vn/dlsearch$' => ['vn/download/search?id=1', ['ext' => 'html']],
|
|
'vn/dl/:id/[:bit]$' => ['vn/download/download', ['ext' => 'html'], ['id' => '\d+', 'bit' => '[0-9]+']],
|
|
'vn/prodl/:id$' => ['vn/download/prodownload', ['ext' => 'html'], ['id' => '\d+']],
|
|
'vn/pinglunadd$' => ['vn/pinglun/add', ['method' => 'post'], ['id' => '\d+']],
|
|
'vn/pinglun/[:type]/[:cid]$' => ['vn/pinglun/lists', [], ['type' => '[0-9a-zA-Z_-]+', 'cid' => '\d+']],
|
|
]);
|
|
|
|
return [
|
|
'__pattern__' => [
|
|
'name' => '\w+',
|
|
],
|
|
// 路由规则定义
|
|
'login$' => ['index/customer/index', ['ext' => 'html']],
|
|
'logout$' => ['index/customer/logout', ['ext' => 'html']],
|
|
'register$' => ['index/customer/register', ['ext' => 'html']],
|
|
'forgetpwd$' => ['index/customer/forgetpwd', ['ext' => 'html']],
|
|
'authcode/[:id]' => ['index/authcode/verify', ['ext' => 'html'], ['id' => '[a-zA-Z0-9]+']],
|
|
//英国路由
|
|
'uk/login$' => ['uk/customer/index', ['ext' => 'html']],
|
|
'uk/logout$' => ['uk/customer/logout', ['ext' => 'html']],
|
|
'uk/register$' => ['uk/customer/register', ['ext' => 'html']],
|
|
'uk/forgetpwd$' => ['uk/customer/forgetpwd', ['ext' => 'html']],
|
|
'uk/authcode/[:id]' => ['uk/authcode/verify', ['ext' => 'html'], ['id' => '[a-zA-Z0-9]+']],
|
|
//美国路由
|
|
'us/login$' => ['us/customer/index', ['ext' => 'html']],
|
|
'us/logout$' => ['us/customer/logout', ['ext' => 'html']],
|
|
'us/register$' => ['us/customer/register', ['ext' => 'html']],
|
|
'us/forgetpwd$' => ['us/customer/forgetpwd', ['ext' => 'html']],
|
|
'us/authcode/[:id]' => ['us/authcode/verify', ['ext' => 'html'], ['id' => '[a-zA-Z0-9]+']],
|
|
//印尼路由
|
|
'id/login$' => ['id/customer/index', ['ext' => 'html']],
|
|
'id/logout$' => ['id/customer/logout', ['ext' => 'html']],
|
|
'id/register$' => ['id/customer/register', ['ext' => 'html']],
|
|
'id/forgetpwd$' => ['id/customer/forgetpwd', ['ext' => 'html']],
|
|
'id/authcode/[:id]' => ['id/authcode/verify', ['ext' => 'html'], ['id' => '[a-zA-Z0-9]+']],
|
|
//泰国路由
|
|
'th/login$' => ['th/customer/index', ['ext' => 'html']],
|
|
'th/logout$' => ['th/customer/logout', ['ext' => 'html']],
|
|
'th/register$' => ['th/customer/register', ['ext' => 'html']],
|
|
'th/forgetpwd$' => ['th/customer/forgetpwd', ['ext' => 'html']],
|
|
'th/authcode/[:id]' => ['th/authcode/verify', ['ext' => 'html'], ['id' => '[a-zA-Z0-9]+']],
|
|
//越南路由
|
|
'vn/login$' => ['vn/customer/index', ['ext' => 'html']],
|
|
'vn/logout$' => ['vn/customer/logout', ['ext' => 'html']],
|
|
'vn/register$' => ['vn/customer/register', ['ext' => 'html']],
|
|
'vn/forgetpwd$' => ['vn/customer/forgetpwd', ['ext' => 'html']],
|
|
'vn/authcode/[:id]' => ['vn/authcode/verify', ['ext' => 'html'], ['id' => '[a-zA-Z0-9]+']],
|
|
// 路由规则定义
|
|
'signin$' => ['admin/passport/index', []],
|
|
'signout$' => ['admin/passport/logout', []],
|
|
'adminregister$' => ['admin/passport/register', []],
|
|
'adminforgetpwd$' => ['admin/passport/forgetpwd', []],
|
|
'captcha/[:id]' => ['admin/authcode/verify', ['ext' => 'html'], ['id' => '[a-zA-Z0-9]+']],
|
|
// // 路由规则定义
|
|
// 'signin$' => ['adminUK/passport/index', []],
|
|
// 'signout$' => ['adminUK/passport/logout', []],
|
|
// 'adminregister$' => ['adminUK/passport/register', []],
|
|
// 'adminforgetpwd$' => ['adminUK/passport/forgetpwd', []],
|
|
// 'captcha/[:id]' => ['adminUK/authcode/verify', ['ext' => 'html'], ['id' => '[a-zA-Z0-9]+']],
|
|
];
|