api.php 944 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Http\Request;
  3. use Illuminate\Support\Facades\Route;
  4. /*
  5. |--------------------------------------------------------------------------
  6. | API Routes
  7. |--------------------------------------------------------------------------
  8. |
  9. | Here is where you can register API routes for your application. These
  10. | routes are loaded by the RouteServiceProvider within a group which
  11. | is assigned the "api" middleware group. Enjoy building your API!
  12. |
  13. */
  14. Route::middleware('auth:api')->get('/user', function (Request $request) {
  15. return $request->user();
  16. });
  17. //生成swagger.json文件
  18. Route::get("/swagger","BaseController@swagger");
  19. //读取swagger内容
  20. Route::get("/loadswagger","BaseController@loadSwagger");
  21. Route::get("/test","BaseController@test");
  22. //校验微信服务器
  23. Route::any("/checkServer/{code}","WechatController@checkServer");
  24. //设置微信菜单
  25. Route::any("/wechat/setmenu","WechatController@setMenu");