<?php

namespace App\Http\Controllers\API\Admin;

use App\Http\Controllers\Controller;
use App\Services\ConfigService;
use Illuminate\Http\Request;

class ConfigController extends Controller
{

    //获取站点配置信息
    public function GetConfigInfo(Request $request){
      $userid = $request->get('userid');//中间件产生的参数
      $group=$request->get('role');
      $is_admin=false;
      if(in_array($group,[1])){
        $is_admin=true;
      }
        $configs = new ConfigService();
        return $configs->GetConfigInfo(['站点名称','站点图片'],$is_admin);
    }
    public function SaveConfig(){

        $data = request('data');
        if(count($data)>0){
          $configs = new ConfigService();
          return $configs->SaveConfig($data);
        }

    }
}
