first commit
This commit is contained in:
142
app/adminapi/controller/setting/web/WebSettingController.php
Normal file
142
app/adminapi/controller/setting/web/WebSettingController.php
Normal file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
namespace app\adminapi\controller\setting\web;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\setting\web\WebSettingLogic;
|
||||
use app\adminapi\validate\setting\WebSettingValidate;
|
||||
|
||||
/**
|
||||
* 网站设置
|
||||
* Class WebSettingController
|
||||
* @package app\adminapi\controller\setting
|
||||
*/
|
||||
class WebSettingController extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取网站信息
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/12/28 15:44
|
||||
*/
|
||||
public function getWebsite()
|
||||
{
|
||||
$result = WebSettingLogic::getWebsiteInfo();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置网站信息
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/12/28 15:45
|
||||
*/
|
||||
public function setWebsite()
|
||||
{
|
||||
$params = (new WebSettingValidate())->post()->goCheck('website');
|
||||
WebSettingLogic::setWebsiteInfo($params);
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取网站配置
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/12/28 15:44
|
||||
*/
|
||||
public function getWebsiteProject()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$result = WebSettingLogic::getWebsiteProject($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(WebSettingLogic::getError());
|
||||
}
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置网站配置
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/12/28 15:45
|
||||
*/
|
||||
public function setWebsiteProject()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = WebSettingLogic::setWebsiteProject($params);
|
||||
if (false === $result) {
|
||||
return $this->fail(WebSettingLogic::getError() ?: '操作失败');
|
||||
}
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取国际区号
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/12/28 16:10
|
||||
*/
|
||||
public function getRegioncodeAll()
|
||||
{
|
||||
$result = WebSettingLogic::getRegioncodeAll();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取备案信息
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/12/28 16:10
|
||||
*/
|
||||
public function getCopyright()
|
||||
{
|
||||
$result = WebSettingLogic::getCopyright();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置备案信息
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/12/28 16:10
|
||||
*/
|
||||
public function setCopyright()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = WebSettingLogic::setCopyright($params);
|
||||
if (false === $result) {
|
||||
return $this->fail(WebSettingLogic::getError() ?: '操作失败');
|
||||
}
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置政策协议
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/2/15 11:00 上午
|
||||
*/
|
||||
public function setAgreement()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
WebSettingLogic::setAgreement($params);
|
||||
return $this->success('设置成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取政策协议
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/2/15 11:16 上午
|
||||
*/
|
||||
public function getAgreement()
|
||||
{
|
||||
$result = WebSettingLogic::getAgreement();
|
||||
return $this->data($result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user