89 lines
5.4 KiB
PHP
89 lines
5.4 KiB
PHP
<?php
|
|
|
|
use think\facade\Route;
|
|
|
|
if (env('is_test')) {
|
|
Route::post('/front/login', 'app\admin\Login@login')->validate(\app\validate\admin\LoginValidate::class);
|
|
Route::group('/front', function () {
|
|
Route::get('/homeData', 'app\front\Index@homeData');
|
|
Route::group('/product', function () {
|
|
Route::get('/detail/:id', 'app\front\Product@detail')->validate(\app\validate\IdRequireValidate::class);
|
|
Route::get('/sync', 'app\front\Product@sync');
|
|
});
|
|
Route::get("/order/list", 'app\front\Order@list');
|
|
})->middleware([\app\middleware\FrontRequest::class, \app\middleware\CorsMiddleware::class, \app\middleware\ValidateOpenId::class]);
|
|
|
|
// 授权
|
|
Route::group('/oauth', function () {
|
|
Route::post('/approval', 'app\front\Oauth@approval');
|
|
Route::post('/accessToken', 'app\front\Oauth@accessToken');
|
|
Route::post('/checkToken', 'app\front\Oauth@checkAccessToken')->middleware(\app\middleware\ValidateOpenId::class);
|
|
Route::post('/bindMobile', 'app\front\Oauth@bindMobile')->middleware(\app\middleware\ValidateOpenId::class)->validate(\app\validate\front\LoginValidate::class, 'bindMobile');
|
|
})->middleware(\app\middleware\CorsMiddleware::class);
|
|
// 签约
|
|
Route::group('/agreement', function () {
|
|
Route::post('', 'app\front\agreement');
|
|
Route::post('/approval', 'app\front\Agreement@agreeApproval');
|
|
Route::post('/release', 'app\front\Agreement@releaseForMerchant');
|
|
Route::post('/releaseNotify', 'app\front\Agreement@releaseNotify'); // 解约通知
|
|
Route::post('/notify', 'app\front\Agreement@agreeNotify'); // 签约通知
|
|
Route::post('/payNotify', 'app\front\Agreement@payNotify'); // 协议通知
|
|
Route::post('/unsubscribe', 'app\front\Agreement@unsubscribe'); //取消订阅
|
|
Route::post('/getBindMobile', 'app\front\Agreement@getBindMobile'); //取消订阅
|
|
Route::post('/getExchangeStatus', 'app\front\Agreement@getExchangeStatus');
|
|
Route::post('/releaseSendSms', 'app\front\Agreement@releaseSendSms')->validate(\app\validate\front\LoginValidate::class, 'sendReleaseSms');
|
|
})->middleware([\app\middleware\ValidateOpenId::class, \app\middleware\CorsMiddleware::class]);
|
|
|
|
// 订单
|
|
Route::group('/order', function () {
|
|
Route::post('/rechargeNotify', 'app\front\Order@rechargeNotify');
|
|
Route::get('/monthSale', 'app\front\Order@getMonthSale');
|
|
Route::post('/refund', 'app\front\Order@refund');
|
|
})->middleware(\app\middleware\CorsMiddleware::class);
|
|
|
|
Route::post('/front/loginSendSms', 'app\front\Login@loginSendSms')->validate(\app\validate\front\LoginValidate::class, 'sendSms')->middleware(\app\middleware\CorsMiddleware::class);
|
|
} else {
|
|
|
|
Route::group('/api', function () {
|
|
Route::post('/front/login', 'app\admin\Login@login')->validate(\app\validate\admin\LoginValidate::class);
|
|
Route::group('/front', function () {
|
|
Route::get('/homeData', 'app\front\Index@homeData');
|
|
Route::group('/product', function () {
|
|
Route::get('/detail/:id', 'app\front\Product@detail')->validate(\app\validate\IdRequireValidate::class);
|
|
Route::get('/sync', 'app\front\Product@sync');
|
|
});
|
|
Route::get("/order/list", 'app\front\Order@list');
|
|
})->middleware([\app\middleware\FrontRequest::class, \app\middleware\ValidateOpenId::class]);
|
|
|
|
// 授权
|
|
Route::group('/oauth', function () {
|
|
Route::post('/approval', 'app\front\Oauth@approval');
|
|
Route::post('/accessToken', 'app\front\Oauth@accessToken');
|
|
Route::post('/checkToken', 'app\front\Oauth@checkAccessToken')->middleware(\app\middleware\ValidateOpenId::class);
|
|
Route::post('/bindMobile', 'app\front\Oauth@bindMobile')->middleware(\app\middleware\ValidateOpenId::class)->validate(\app\validate\front\LoginValidate::class, 'bindMobile');
|
|
});
|
|
// 签约
|
|
Route::group('/agreement', function () {
|
|
Route::post('', 'app\front\agreement');
|
|
Route::post('/approval', 'app\front\Agreement@agreeApproval');
|
|
Route::post('/release', 'app\front\Agreement@releaseForMerchant');
|
|
Route::post('/releaseNotify', 'app\front\Agreement@releaseNotify'); // 解约通知
|
|
Route::post('/notify', 'app\front\Agreement@agreeNotify'); // 签约通知
|
|
Route::post('/payNotify', 'app\front\Agreement@payNotify'); // 协议通知
|
|
Route::post('/unsubscribe', 'app\front\Agreement@unsubscribe'); //取消订阅
|
|
Route::post('/getBindMobile', 'app\front\Agreement@getBindMobile'); //取消订阅
|
|
Route::post('/getExchangeStatus', 'app\front\Agreement@getExchangeStatus');
|
|
Route::post('/releaseSendSms', 'app\front\Agreement@releaseSendSms')->validate(\app\validate\front\LoginValidate::class, 'sendReleaseSms');
|
|
})->middleware(\app\middleware\ValidateOpenId::class);
|
|
|
|
// 订单
|
|
Route::group('/order', function () {
|
|
Route::post('/rechargeNotify', 'app\front\Order@rechargeNotify');
|
|
Route::get('/monthSale', 'app\front\Order@getMonthSale');
|
|
Route::post('/refund', 'app\front\Order@refund');
|
|
});
|
|
|
|
Route::post('/front/loginSendSms', 'app\front\Login@loginSendSms')->validate(\app\validate\front\LoginValidate::class, 'sendSms');
|
|
})->middleware(\app\middleware\CorsMiddleware::class);
|
|
}
|