123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace app\admin\controller;
- use cmf\controller\AdminBaseController;
- class StorageController extends AdminBaseController
- {
-
- public function index()
- {
- $storage = cmf_get_option('storage');
- if (empty($storage)) {
- $storage['type'] = 'Local';
- $storage['storages'] = ['Local' => ['name' => '本地']];
- } else {
- if (empty($storage['type'])) {
- $storage['type'] = 'Local';
- }
- if (empty($storage['storages']['Local'])) {
- $storage['storages']['Local'] = ['name' => '本地'];
- }
- }
- $this->assign($storage);
- return $this->fetch();
- }
-
- public function settingPost()
- {
- $post = $this->request->post();
- $storage = cmf_get_option('storage');
- $storage['type'] = $post['type'];
- cmf_set_option('storage', $storage);
- $this->success("设置成功!", '');
- }
- }
|