123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- /**
- * @Created by PhpStorm
- * @author: Kirin
- * @day: 2024/11/19
- * @time: 11:16
- */
- use app\http\middleware\AllowOriginMiddleware;
- use app\http\middleware\api\AuthTokenMiddleware;
- use app\http\middleware\api\BlockerMiddleware;
- use app\http\middleware\api\LocationMiddleware;
- use app\http\middleware\api\MemberTypeMiddleware;
- use app\http\middleware\StationOpenMiddleware;
- use think\facade\Route;
- Route::group('api', function () {
- //城市列表
- Route::get('city', 'Pub/city');
- //城市列表
- Route::get('cityList', 'Pub/cityList');
- //APP版本号
- Route::get('version', 'Pub/version');
- //登陆相关
- Route::group(function () {
- //账号密码登录
- Route::post('login', 'Login/login')->name('login');
- //注册
- Route::post('register', 'Login/register')->name('register');
- //获取发短信的key
- Route::get('verify_code', 'Login/verifyCode')->name('verifyCode');
- //手机号登录
- Route::post('login/mobile', 'Login/mobile')->name('loginMobile');
- //图片验证码
- Route::get('sms_captcha', 'Login/captcha')->name('captcha');
- //验证码发送
- Route::post('verify', 'Login/verify')->name('registerVerify');
- //手机号修改密码
- Route::post('pwd/reset', 'Login/reset')->name('resetPwd');
- //图形验证码
- Route::get('ajcaptcha', 'Login/ajcaptcha')->name('ajcaptcha');
- //图形验证码
- Route::post('ajcheck', 'Login/ajcheck')->name('ajcheck');
- });
- //定位接口
- Route::group(function () {
- //可登可不登的接口
- Route::group('', function () {
- //公共类
- Route::get('index', 'Pub/index')->name('index');//首页
- })->middleware(AuthTokenMiddleware::class, false);
- //用户接口
- Route::group('', function () {
- //退出登录
- Route::get('logout', 'Login/logout')->name('logout');
- //修改交易密码
- Route::post('trade_pwd/reset', 'Login/reset_trade_pwd')->middleware(BlockerMiddleware::class)->name('resetTradePwd');
- //上传图片
- Route::post('upload', 'Pub/upload_image')->middleware(BlockerMiddleware::class)->name('uploadImage');
- //修改账号
- Route::put('account', 'user.User/setAccount')->name('setAccount')->middleware(BlockerMiddleware::class)->name('setAccount');
- //用户相关
- Route::group('user', function () {
- //用户信息
- Route::get('info', 'user.User/info')->name('userInfo');
- //转账
- //资金流
- //推广
- });
- })->middleware(AuthTokenMiddleware::class);
- //装修工接口
- Route::group('', function () {
- })->middleware(AuthTokenMiddleware::class)->middleware(MemberTypeMiddleware::class, 'worker');
- //设计师接口
- Route::group('', function () {
- })->middleware(AuthTokenMiddleware::class)->middleware(MemberTypeMiddleware::class, 'designer');
- //业务员接口
- Route::group('', function () {
- })->middleware(AuthTokenMiddleware::class)->middleware(MemberTypeMiddleware::class, 'salesperson');
- })->middleware(LocationMiddleware::class);
- })
- ->prefix('api.')
- ->middleware(AllowOriginMiddleware::class)
- ->middleware(StationOpenMiddleware::class);
|