Config.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Think.Admin
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://think.ctolog.com
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // +----------------------------------------------------------------------
  11. // | github开源项目:https://github.com/zoujingli/Think.Admin
  12. // +----------------------------------------------------------------------
  13. namespace app\admin\controller;
  14. use controller\BasicAdmin;
  15. use service\LogService;
  16. /**
  17. * 后台参数配置控制器
  18. * Class Config
  19. * @package app\admin\controller
  20. * @author Anyon <zoujingli@qq.com>
  21. * @date 2017/02/15 18:05
  22. */
  23. class Config extends BasicAdmin
  24. {
  25. /**
  26. * 当前默认数据模型
  27. * @var string
  28. */
  29. public $table = 'SystemConfig';
  30. /**
  31. * 当前页面标题
  32. * @var string
  33. */
  34. public $title = '网站参数配置';
  35. /**
  36. * 显示系统常规配置
  37. */
  38. public function index()
  39. {
  40. if (!$this->request->isPost()) {
  41. return view('', ['title' => $this->title]);
  42. }
  43. foreach ($this->request->post() as $key => $vo) {
  44. sysconf($key, $vo);
  45. }
  46. LogService::write('系统管理', '修改系统配置参数成功');
  47. $this->success('数据修改成功!', '');
  48. }
  49. /**
  50. * 文件存储配置
  51. */
  52. public function file()
  53. {
  54. $this->title = '文件存储配置';
  55. $alert = ['type' => 'success', 'title' => '操作提示', 'content' => '文件引擎参数影响全局文件上传功能,请勿随意修改!'];
  56. $this->assign('alert', $alert);
  57. return $this->index();
  58. }
  59. }