91 lines
4.3 KiB
PHP
91 lines
4.3 KiB
PHP
<?php
|
||
/*
|
||
* @Author: YwxApp <ywx@ywxapp.cn>
|
||
* @Date: 2026-07-19 17:30:04
|
||
* @LastEditors: YwxApp <ywx@ywxapp.cn>
|
||
* @LastEditTime: 2026-08-06 23:10:15
|
||
* @Description:
|
||
* @FilePath: \ywxapp_dev\addon\wxchat\route\app.php
|
||
* @CustomString: Copyright (c) 2026 YwxApp
|
||
*/
|
||
// +----------------------------------------------------------------------
|
||
// | YwxApp [ WE CAN DO IT JUST THINK ]
|
||
// +----------------------------------------------------------------------
|
||
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
|
||
// +----------------------------------------------------------------------
|
||
// | Author: ywxapp<admin@ywxapp.cn>
|
||
// +----------------------------------------------------------------------
|
||
use think\facade\Route;
|
||
|
||
/**
|
||
* 插件路由:wxchat
|
||
*
|
||
* 路由按「控制器命名空间层」分为三组,并带 URL 前缀(对外地址统一加层前缀):
|
||
* - 对外 API -> /wxchat/api/* 对应 controller/api/
|
||
* - 会员中心 -> /wxchat/member/* 对应 controller/member/
|
||
* - 后台管理 -> /wxchat/backend/* 对应 controller/backend/
|
||
*
|
||
* 分组用 Route::group('前缀', ...) 设置 URL 前缀,->prefix('层/') 设置控制器层。
|
||
* 注意:全局 config/route.php 的 route_complete_match 为 false,
|
||
* 因此所有“无变量”的精确路由必须 ->completeMatch(),避免被 /:action 兄弟路由前缀吞掉。
|
||
*/
|
||
|
||
// ===== 对外 API(controller/api/) ===== URL: /wxchat/api/*
|
||
Route::group('api', function () {
|
||
Route::rule('', 'Index/index');
|
||
Route::rule('follow', 'Follow/index')->completeMatch();
|
||
Route::rule('follow/:action', 'Follow/:action');
|
||
Route::rule('friend', 'Friend/index')->completeMatch();
|
||
Route::rule('friend/:action', 'Friend/:action');
|
||
Route::rule('gift', 'Gift/index')->completeMatch();
|
||
Route::rule('gift/:action', 'Gift/:action');
|
||
Route::rule('index', 'Index/index')->completeMatch();
|
||
Route::rule('index/:action', 'Index/:action');
|
||
Route::rule('indexi', 'Indexi/index')->completeMatch();
|
||
Route::rule('indexi/:action', 'Indexi/:action');
|
||
Route::rule('login', 'Login/index')->completeMatch();
|
||
Route::rule('login/:action', 'Login/:action');
|
||
Route::rule('lottery', 'Lottery/index')->completeMatch();
|
||
Route::rule('lottery/:action', 'Lottery/:action');
|
||
Route::rule('message', 'Message/index')->completeMatch();
|
||
Route::rule('message/:action', 'Message/:action');
|
||
Route::rule('moment', 'Moment/index')->completeMatch();
|
||
Route::rule('moment/:action', 'Moment/:action');
|
||
Route::rule('recommend', 'Recommend/index')->completeMatch();
|
||
Route::rule('recommend/:action', 'Recommend/:action');
|
||
Route::rule('search', 'Search/index')->completeMatch();
|
||
Route::rule('search/:action', 'Search/:action');
|
||
Route::rule('test', 'Test/index')->completeMatch();
|
||
Route::rule('test/:action', 'Test/:action');
|
||
Route::rule('unread', 'Unread/index')->completeMatch();
|
||
Route::rule('unread/:action', 'Unread/:action');
|
||
Route::rule('user/index', 'Member/index') ;
|
||
Route::rule('user/:action', 'Member/:action');
|
||
Route::rule('feedback', 'Feedback/index')->completeMatch();
|
||
Route::rule('feedback/:action', 'Feedback/:action');
|
||
Route::rule('task', 'Task/index')->completeMatch();
|
||
Route::rule('task/:action', 'Task/:action');
|
||
})->prefix('api/')->mergeRuleRegex();
|
||
|
||
// ===== 会员中心(controller/member/) ===== URL: /wxchat/member/*
|
||
Route::group('member', function () {
|
||
Route::rule('auth', 'Auth/index')->completeMatch();
|
||
Route::rule('auth/:action', 'Auth/:action');
|
||
Route::rule('task', 'Task/index')->completeMatch();
|
||
Route::rule('task/:action', 'Task/:action');
|
||
Route::rule('room', 'Room/index')->completeMatch();
|
||
Route::rule('room/:action', 'Room/:action');
|
||
Route::rule('family', 'Family/index')->completeMatch();
|
||
Route::rule('family/:action', 'Family/:action');
|
||
})->prefix('member/');
|
||
|
||
// ===== 后台管理(controller/backend/) ===== URL: /wxchat/backend/*
|
||
Route::group('backend', function () {
|
||
Route::rule('task', 'WxchatTask/index')->completeMatch();
|
||
Route::rule('task/:action', 'WxchatTask/:action');
|
||
Route::rule('auth', 'WxchatAuth/index')->completeMatch();
|
||
Route::rule('auth/:action', 'WxchatAuth/:action');
|
||
Route::rule('room', 'WxchatRoom/index')->completeMatch();
|
||
Route::rule('room/:action', 'WxchatRoom/:action');
|
||
})->prefix('backend/');
|