mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-27 14:10:35 +00:00
44 lines
1.5 KiB
PHP
44 lines
1.5 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||
// +----------------------------------------------------------------------
|
||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||
// +----------------------------------------------------------------------
|
||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||
// +----------------------------------------------------------------------
|
||
// | Author: CRMEB Team <admin@crmeb.com>
|
||
// +----------------------------------------------------------------------
|
||
use think\facade\Route;
|
||
use think\facade\Config;
|
||
use think\Response;
|
||
use app\http\middleware\AllowOriginMiddleware;
|
||
|
||
/**
|
||
* 无需授权的接口
|
||
*/
|
||
Route::group(function () {
|
||
//用户名密码登录
|
||
Route::post('login', 'Login/login')->name('AdminLogin');
|
||
//后台登录页面数据
|
||
Route::get('login/info', 'Login/info');
|
||
//下载文件
|
||
Route::get('download', 'PublicController/download');
|
||
//验证码
|
||
Route::get('captcha_pro', 'Login/captcha');
|
||
//测试路由
|
||
Route::get('index', 'Test/index');
|
||
|
||
})->middleware(AllowOriginMiddleware::class);
|
||
|
||
/**
|
||
* miss 路由
|
||
*/
|
||
Route::miss(function () {
|
||
if (app()->request->isOptions()) {
|
||
$header = Config::get('cookie.header');
|
||
$header['Access-Control-Allow-Origin'] = app()->request->header('origin');
|
||
return Response::create('ok')->code(200)->header($header);
|
||
} else
|
||
return Response::create()->code(404);
|
||
});
|