You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							145 lines
						
					
					
						
							5.1 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							145 lines
						
					
					
						
							5.1 KiB
						
					
					
				
								<?php
							 | 
						|
								
							 | 
						|
								use Illuminate\Http\Request;
							 | 
						|
								use Illuminate\Support\Facades\Route;
							 | 
						|
								
							 | 
						|
								/*
							 | 
						|
								|--------------------------------------------------------------------------
							 | 
						|
								| API Routes
							 | 
						|
								|--------------------------------------------------------------------------
							 | 
						|
								|
							 | 
						|
								| Here is where you can register API routes for your application. These
							 | 
						|
								| routes are loaded by the RouteServiceProvider within a group which
							 | 
						|
								| is assigned the "api" middleware group. Enjoy building your API!
							 | 
						|
								|
							 | 
						|
								*/
							 | 
						|
								
							 | 
						|
								/*Route::middleware('auth:api')->get('/user', function (Request $request) {
							 | 
						|
								    return $request->user();
							 | 
						|
								});*/
							 | 
						|
								
							 | 
						|
								# 登录
							 | 
						|
								Route::post('login', 'App\Http\Controllers\Api\LoginController@login');
							 | 
						|
								
							 | 
						|
								# 微信相关
							 | 
						|
								Route::namespace('App\Http\Controllers\Api')->group(function () {
							 | 
						|
									# 微信支付
							 | 
						|
									Route::prefix('wxpay')->group(function () {
							 | 
						|
										Route::post('notify/{agent_id}', 'WxpayController@notify')->name('wxpay_notify'); //异步通知,aid为代理商ID
							 | 
						|
										Route::post('refund/{agent_id}', 'WxpayController@refund')->name('wxpay_refund'); //退款通知,aid为代理商ID
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
									# 跳转到外部小程序支付
							 | 
						|
									Route::post('share_pay', 'SharePayController@pay');
							 | 
						|
								
							 | 
						|
									# 小程序授权等相关
							 | 
						|
									Route::any('auth_event', 'MiniProgramController@authEvent');
							 | 
						|
									Route::any('msg_event/{appid?}', 'MiniProgramController@msgEvent');
							 | 
						|
								});
							 | 
						|
								
							 | 
						|
								# 仅用于测试
							 | 
						|
								Route::any('t/index', App\Http\Controllers\Api\TestController::class . '@index');
							 | 
						|
								
							 | 
						|
								# 无需登录可获取数据
							 | 
						|
								Route::namespace('App\Http\Controllers\Api')
							 | 
						|
									->middleware(App\Http\Middleware\ApiBase::class)
							 | 
						|
									->group(function () {
							 | 
						|
									# 首页
							 | 
						|
									Route::post('index', 'IndexController@index');
							 | 
						|
								
							 | 
						|
									# 频道
							 | 
						|
									Route::prefix('channel')->group(function () {
							 | 
						|
										Route::post('list', 'ChannelController@index'); //频道列表
							 | 
						|
										Route::post('product', 'ChannelController@product'); //频道产品列表
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
									# 产品
							 | 
						|
									Route::prefix('agent_product')->group(function () {
							 | 
						|
										Route::post('list', 'AgentProductController@index'); //产品列表
							 | 
						|
										Route::post('guess', 'AgentProductController@guessLike'); //猜你喜欢
							 | 
						|
										Route::post('show', 'AgentProductController@show'); //产品详情
							 | 
						|
										Route::post('recommend', 'AgentProductController@recommendList'); //我的下方推荐
							 | 
						|
										Route::post('hot', 'AgentProductController@hotList'); //人气爆款列表
							 | 
						|
										Route::post('search', 'AgentProductController@search'); //首页搜索框
							 | 
						|
										Route::post('travel_search', 'AgentProductController@travel_search'); //旅游线路搜索
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
									# 产品分类
							 | 
						|
									Route::prefix('category')->group(function() {
							 | 
						|
										Route::post('list', 'CategoryController@index');
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
									# 公告
							 | 
						|
									Route::prefix('notice')->group(function () {
							 | 
						|
										Route::post('list', 'NoticeController@index'); //公告列表
							 | 
						|
										Route::post('show', 'NoticeController@show'); //公告详情
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
									# 文章
							 | 
						|
									Route::prefix('article')->group(function () {
							 | 
						|
										Route::post('list', 'ArticleController@index'); //文章列表
							 | 
						|
										Route::post('show', 'ArticleController@show'); //文章详情
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
									# 代理商信息
							 | 
						|
									Route::post('agent_info/{type}', 'AgentInfoController@info');
							 | 
						|
								
							 | 
						|
									# 专题
							 | 
						|
									Route::prefix('special')->group(function () {
							 | 
						|
										Route::post('show', 'SpecialController@show'); //专题详情
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
								});
							 | 
						|
								
							 | 
						|
								# 需要登录才能请求
							 | 
						|
								Route::namespace('App\Http\Controllers\Api')
							 | 
						|
									->middleware([App\Http\Middleware\ApiBase::class, App\Http\Middleware\ApiAuth::class])
							 | 
						|
									->group(function () {
							 | 
						|
								    # 我的频道
							 | 
						|
								    Route::prefix('user_channel')->group(function () {
							 | 
						|
								        Route::post('list', 'UserChannelController@index'); //我的频道列表
							 | 
						|
								        Route::post('update', 'UserChannelController@update'); //编辑我的频道
							 | 
						|
								    });
							 | 
						|
								
							 | 
						|
								    # 订单
							 | 
						|
									Route::prefix('order')->group(function () {
							 | 
						|
										Route::post('list', 'OrderController@index'); //订单列表
							 | 
						|
										Route::post('create', 'OrderController@create'); //创建订单
							 | 
						|
										Route::post('save', 'OrderController@save'); //修改订单
							 | 
						|
										Route::post('price', 'OrderController@getPrice'); //获取订单价格
							 | 
						|
										Route::post('show', 'OrderController@show'); //订单详情
							 | 
						|
										Route::post('refund', 'OrderController@refund'); //申请退款
							 | 
						|
										Route::post('pay', 'OrderController@pay'); //支付
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
									# 核销订单
							 | 
						|
									Route::prefix('verification')->group(function () {
							 | 
						|
										Route::post('verify', 'VerificationController@verify');
							 | 
						|
										Route::post('industry_verify', 'VerificationController@industry_verify'); //行业产品订单核销
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
								    # 短信息
							 | 
						|
									Route::prefix('message')->group(function () {
							 | 
						|
										Route::post('list', 'MessageController@index'); //消息列表
							 | 
						|
										Route::post('show', 'MessageController@show'); //消息列表
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
								    # 收藏
							 | 
						|
									Route::prefix('fav')->group(function () {
							 | 
						|
										Route::post('list', 'UserFavController@index'); //收藏列表
							 | 
						|
										Route::post('create', 'UserFavController@create'); //添加收藏
							 | 
						|
										Route::post('delete', 'UserFavController@delete'); //删除收藏
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
									# 用户
							 | 
						|
									Route::prefix('user')->group(function () {
							 | 
						|
										Route::post('info', 'UserController@info'); //解密用户信息
							 | 
						|
										Route::post('profile', 'UserController@profile'); //解密用户信息
							 | 
						|
										//Route::post('bindingMobile', 'UserController@bindingMobile'); //解密用户信息
							 | 
						|
									});
							 | 
						|
								
							 | 
						|
									# 文件上传
							 | 
						|
									Route::prefix('upload')->group(function () {
							 | 
						|
										Route::post('image', 'UploadController@image'); //图片上传
							 | 
						|
									});
							 | 
						|
								});
							 |