<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;

Route::get('/', function (Request $request) {
	if (Route::has('home')){
		return redirect()->route('home', $request->all());
	}else{
		if (file_exists(resource_path('web/dist/index.html'))){
			return file_get_contents(resource_path('web/dist/index.html'));
		}else{
			return view('welcome');
		}
	}
})->name('welcome');

Route::get('/admin', function (Request $request) {
	if (file_exists(resource_path('admin/dist/index.html'))){
		return file_get_contents(resource_path('admin/dist/index.html'));
	}else {
		return view('weclome');
	}
})->name('admin');