第三段完善 代理商绑定 激活等 正式上线的版本
This commit is contained in:
@@ -56,22 +56,51 @@ class Config extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->title = '系统参数配置';
|
||||
$this->files = Storage::types();
|
||||
$this->plugins = Plugin::get(null, true);
|
||||
$this->issuper = AdminService::isSuper();
|
||||
$this->systemid = ModuleService::getRunVar('uni');
|
||||
$this->framework = ModuleService::getLibrarys('topthink/framework');
|
||||
$this->thinkadmin = ModuleService::getLibrarys('zoujingli/think-library');
|
||||
if (AdminService::isSuper() && $this->app->session->get('user.password') === md5('admin')) {
|
||||
$url = url('admin/index/pass', ['id' => AdminService::getUserId()]);
|
||||
$this->showErrorMessage = lang("超级管理员账号的密码未修改,建议立即<a data-modal='%s'>修改密码</a>!", [$url]);
|
||||
if ($this->request->isGet()) {
|
||||
$this->title = '系统参数配置';
|
||||
$this->files = Storage::types();
|
||||
$this->plugins = Plugin::get(null, true);
|
||||
$this->issuper = AdminService::isSuper();
|
||||
$this->systemid = ModuleService::getRunVar('uni');
|
||||
$this->framework = ModuleService::getLibrarys('topthink/framework');
|
||||
$this->thinkadmin = ModuleService::getLibrarys('zoujingli/think-library');
|
||||
if (AdminService::isSuper() && $this->app->session->get('user.password') === md5('admin')) {
|
||||
$url = url('admin/index/pass', ['id' => AdminService::getUserId()]);
|
||||
$this->showErrorMessage = lang("超级管理员账号的密码未修改,建议立即<a data-modal='%s'>修改密码</a>!", [$url]);
|
||||
}
|
||||
uasort($this->plugins, static function ($a, $b) {
|
||||
if ($a['space'] === $b['space']) return 0;
|
||||
return $a['space'] > $b['space'] ? 1 : -1;
|
||||
});
|
||||
$this->fetch();
|
||||
} else {
|
||||
$data = $this->request->post();
|
||||
foreach ($data as $k => $v) {
|
||||
sysconf($k, $v);
|
||||
}
|
||||
$this->success('参数修改成功!');
|
||||
}
|
||||
uasort($this->plugins, static function ($a, $b) {
|
||||
if ($a['space'] === $b['space']) return 0;
|
||||
return $a['space'] > $b['space'] ? 1 : -1;
|
||||
});
|
||||
$this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统配置参数
|
||||
* @param string $name 配置名称
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
return sysconf($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统配置参数
|
||||
* @param string $name 配置名称
|
||||
* @param mixed $value 配置值
|
||||
* @return mixed
|
||||
*/
|
||||
public function set($name, $value)
|
||||
{
|
||||
return sysconf($name, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user