Files
BlackFruit-UI/plugins/addon/theme_configurator/route.php
yiqiu 10f71008da
All checks were successful
continuous-integration/drone/push Build is passing
测试前端接口
2025-11-21 14:26:30 +08:00

34 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
use think\facade\Route;
// 前台读取接口(对齐官方示例插件路由中间件,仅使用插件自有接口 /console/v1/theme/config
Route::group('console/v1', function () {
Route::get('theme/config', "\\addon\\theme_configurator\\controller\\clientarea\\ThemeController@config")
->append([
'_plugin' => 'theme_configurator',
'_controller' => 'theme',
'_action' => 'config',
]);
})
->middleware(\app\http\middleware\ParamFilter::class)
->middleware(\app\http\middleware\CheckHome::class)
->middleware(\app\http\middleware\RejectRepeatRequest::class);
// 后台配置接口
Route::group(DIR_ADMIN . '/v1', function () {
Route::get('theme/config', "\\addon\\theme_configurator\\controller\\ThemeController@config")
->append([
'_plugin' => 'theme_configurator',
'_controller' => 'theme',
'_action' => 'config',
])
->middleware(\app\http\middleware\CheckAdmin::class);
Route::post('theme/config', "\\addon\\theme_configurator\\controller\\ThemeController@save")
->append([
'_plugin' => 'theme_configurator',
'_controller' => 'theme',
'_action' => 'save',
])
->middleware(\app\http\middleware\CheckAdmin::class);
})->middleware(\app\http\middleware\ParamFilter::class);