From a6736d4c1767175d75a10a4460e69ccb353fe5aa Mon Sep 17 00:00:00 2001 From: liapples Date: Wed, 28 Jul 2021 18:47:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9wechat=5Fcert=5Fpath=E6=8B=BC?= =?UTF-8?q?=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/wechat.php | 2 +- routes/api.php | 94 ++++++++++++++++++++++++++--------------------- 2 files changed, 54 insertions(+), 42 deletions(-) diff --git a/config/wechat.php b/config/wechat.php index ba49fe2..e0d91bc 100644 --- a/config/wechat.php +++ b/config/wechat.php @@ -24,7 +24,7 @@ return [ 'key_path' => env('KEY_PATH',''), 'notify_url' => env('NOTIFY_URL',''), 'refund_notify_url' => env('REFUND_NOTIFY_URL',''), - 'wechat_cret_path' => env('WECHAT_CERT_PATH',''), + 'wechat_cert_path' => env('WECHAT_CERT_PATH',''), 'serial_number' => env('SERIAL_NUMBER',''), ], ], diff --git a/routes/api.php b/routes/api.php index 7cdf421..df6e20b 100644 --- a/routes/api.php +++ b/routes/api.php @@ -21,40 +21,58 @@ use Illuminate\Support\Facades\Route; # 登录 Route::post('login', 'App\Http\Controllers\Api\LoginController@login'); -Route::namespace('App\Http\Controllers\Api') - ->middleware(App\Http\Middleware\AuthApi::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('user_channel')->group(function () { - Route::post('update', 'UserChannelController@update'); //编辑我的频道 - }); +# 无需登录可获取数据 +Route::namespace('App\Http\Controllers\Api')->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@recommend'); //我的下方推荐 - }); + # 产品 + 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@recommend'); //我的下方推荐 + }); - # 产品分类 + # 产品分类 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('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\AuthApi::class) + ->group(function () { + # 我的频道 + Route::prefix('user_channel')->group(function () { + Route::post('update', 'UserChannelController@update'); //编辑我的频道 }); # 订单 @@ -64,18 +82,12 @@ Route::namespace('App\Http\Controllers\Api') 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('article')->group(function () { - Route::post('list', 'ArticleController@index'); //文章列表 - Route::post('show', 'ArticleController@show'); //文章详情 - }); - - # 代理商信息 - Route::prefix('agent_info')->group(function () { - Route::post('about', 'AgentInfoController@about'); //关于我们 - }); + # 核销订单 + Route::post('verification/verify', 'VerificationController@verify'); # 短信息 Route::prefix('message')->group(function () { @@ -95,8 +107,8 @@ Route::namespace('App\Http\Controllers\Api') Route::post('profile', 'UserController@profile'); //解密用户信息 }); - # 专题 - Route::prefix('special')->group(function () { - Route::post('show', 'SpecialController@show'); //专题详情 + # 文件上传 + Route::prefix('upload')->group(function () { + Route::post('image', 'UploadController@image'); //图片上传 }); });