mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 09:21:46 +08:00 
			
		
		
		
	update: route data struct & remove google analytics
This commit is contained in:
		| @@ -15,6 +15,12 @@ class RouteController extends Controller | ||||
|     public function fetch(Request $request) | ||||
|     { | ||||
|         $routes = ServerRoute::get(); | ||||
|         // TODO: remove on 1.8.0 | ||||
|         foreach ($routes as $k => $route) { | ||||
|             $array = json_decode($route->match, true); | ||||
|             if (is_array($array)) $routes[$k]['match'] = $array; | ||||
|         } | ||||
|         // TODO: remove on 1.8.0 | ||||
|         return [ | ||||
|             'data' => $routes | ||||
|         ]; | ||||
| @@ -24,10 +30,16 @@ class RouteController extends Controller | ||||
|     { | ||||
|         $params = $request->validate([ | ||||
|             'remarks' => 'required', | ||||
|             'match' => 'required', | ||||
|             'action' => 'required', | ||||
|             'match' => 'required|array', | ||||
|             'action' => 'required|in:block,dns', | ||||
|             'action_value' => 'nullable' | ||||
|         ], [ | ||||
|             'remarks.required' => '备注不能为空', | ||||
|             'match.required' => '匹配值不能为空', | ||||
|             'action.required' => '动作类型不能为空', | ||||
|             'action.in' => '动作类型参数有误' | ||||
|         ]); | ||||
|         $params['match'] = array_filter($params['match']); | ||||
|         if ($request->input('id')) { | ||||
|             try { | ||||
|                 $route = ServerRoute::find($request->input('id')); | ||||
|   | ||||
| @@ -25,9 +25,9 @@ class ThemeController extends Controller | ||||
|     { | ||||
|         $themeConfigs = []; | ||||
|         foreach ($this->themes as $theme) { | ||||
|             $themeConfigFile = $this->path . "{$theme}/config.php"; | ||||
|             $themeConfigFile = $this->path . "{$theme}/config.json"; | ||||
|             if (!File::exists($themeConfigFile)) continue; | ||||
|             $themeConfig = include($themeConfigFile); | ||||
|             $themeConfig = json_decode(File::get($themeConfigFile), true); | ||||
|             if (!isset($themeConfig['configs']) || !is_array($themeConfig)) continue; | ||||
|             $themeConfigs[$theme] = $themeConfig; | ||||
|             if (config("theme.{$theme}")) continue; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user