Site.php
2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
// +----------------------------------------------------------------------
// | 狂团[kt8.cn]旗下KtAdmin是为独立版SAAS系统而生的快速开发框架.
// +----------------------------------------------------------------------
// | [KtAdmin] Copyright (c) 2022 http://ktadmin.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
namespace app\base\controller\admin\system;
use think\facade\Db;
use app\base\controller\BaseAdmin;
use app\base\model\admin\system\BasicModel;
use Ramsey\Uuid\Uuid;
use think\facade\Session;
/**
* 基础配置控制器 Site
*/
class Site extends BaseAdmin
{
/*
* 基本设置 拉取数据 初始化
*/
public function index(){
$res = BasicModel::getSite();
return success("获取成功",$res);
}
/*
* 修改基础配置
*/
public function setSite(){
$domain = $this->req->param("domain");
if(!$domain) return error("站点域名不可为空");
$webname = $this->req->param("webname");
if(!$webname) return error("站点名称不可为空");
$webtitle = $this->req->param("webtitle");
$copyright = $this->req->param("copyright");
$register_check = $this->req->param("registerCheck");
$registration_audit = $this->req->param("registrationAudit");
$pc_official = $this->req->param("pcOfficial");
$debug = $this->req->param("debug",0);
$addSite = BasicModel::setSite($domain,$webname,$webtitle,$copyright,$register_check,$registration_audit,$pc_official,$debug);
return success("修改成功",$addSite);
}
/*
* 修改logo信息
*/
public function setLogo(){
$user_logo = $this->req->param("userLogo");
$login_logo = $this->req->param("loginLogo");
$pc_logo = $this->req->param("pcLogo");
$setLogo = BasicModel::setLogo($user_logo,$login_logo,$pc_logo);
return success("修改成功",$setLogo);
}
/*
* 修改登录背景
*/
public function setBackground(){
$login_background_status = $this->req->param("loginBackgroundStatus");
$login_background = $this->req->param("loginBackground");
$setBackground = BasicModel::setBackground($login_background,$login_background_status);
return success("修改成功",$setBackground);
}
/*
* 修改其他信息
*/
public function setAdditional(){
$kf_code = $this->req->param("kfCode");
$gzh_code = $this->req->param("gzhCode");
$company_name = $this->req->param("companyName");
$company_address = $this->req->param("companyAddress");
$telephone = $this->req->param("telephone");
$qq = $this->req->param("qq");
$record_number = $this->req->param("recordNumber");
$key_word = $this->req->param("keyWord");
$describe = $this->req->param("describe");
$setAdditional = BasicModel::setAdditional($kf_code,$gzh_code,$company_name,$company_address,$telephone,$qq,$record_number,$key_word,$describe);
return success("修改成功",$setAdditional);
}
}