全栈小学生 0e47055ccb v1.0.0-beta.1
2023-04-15 17:12:49 +08:00

87 lines
2.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
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的saas管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud-admin.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\sys;
use app\adminapi\controller\BaseAdminController;
use app\service\admin\sys\ConfigService;
use think\Response;
class Config extends BaseAdminController
{
/**
* 获取网站设置
* @return Response
*/
public function getWebsite(){
return success((new ConfigService())->getWebSite());
}
/**
* 网站设置
* @return Response
*/
public function setWebsite(){
$data = $this->request->params([
["site_name",""],
["logo",""],
["keywords",""],
["desc",""],
["latitude",""],
["longitude",""],
["province_id",0],
["city_id",0],
["district_id",0],
["address",""],
["full_address",""],
["phone",""],
["business_hours",""],
]);
$this->validate($data, 'app\validate\site\site.update');
(new ConfigService())->setWebSite($data);
return success();
}
/**
* 获取版权信息
* @return Response
*/
public function getCopyright(){
return success((new ConfigService())->getCopyright());
}
/**设置版权信息
* @return Response
*/
public function setCopyright(){
$data = $this->request->params([
['icp', ''],
['gov_record', ''],
['gov_url', ''],
['market_supervision_url', ''],
['logo', ''],
['company_name', ''],
['copyright_link', ''],
['copyright_desc', ''],
]);
(new ConfigService())->setCopyright($data);
return success();
}
/**
* 场景域名
* @return Response
*/
public function getSceneDomain(){
return success((new ConfigService())->getSceneDomain());
}
}