| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace addons\RealAuth\backend\controllers;
- use common\enums\AddonsEnum;
- use Yii;
- /**
- * 设置控制器
- *
- * Class SettingController
- * @package addons\RealAuth\backend\controllers
- */
- class SettingController extends BaseController
- {
- public $enableCsrfValidation = false;
- /**
- * 设置首页
- *
- * @return void
- */
- public function actionIndex()
- {
- if ($this->request->isAjax) {
- $conf = Yii::$app->services->setting->addons->get($this->mall_id, AddonsEnum::ADDONS_NAME_REAL_AUTH, 'basic');
- return $this->success('ok', $conf);
- }
- return $this->render('index');
- }
- /**
- * 保存设置
- *
- * @return void
- */
- public function actionSave()
- {
- if ($this->request->isPost) {
- // 数据提交
- $post = $this->request->post();
- $config = $post;
- $res = \Yii::$app->services->setting->addons->set($this->mall_id, AddonsEnum::ADDONS_NAME_REAL_AUTH, ['basic' => $config]);
- if($res){
- return $this->success('success');
- }
- return $this->error('保存失败');
- }
- }
- }
|