| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\controllers\jushuitan;
- use app\models\Option;
- use app\constants\OptionSetting;
- use app\modules\admin\models\jushuitan\JuShuiTanForm;
- class ConfController extends BaseController
- {
- public $need_mp = false;
- public function actionConf(){
- $conf = Option::get(OptionSetting::JU_SHUI_TAN, 0, 'saas')['value'];
- if($conf){
- $conf = json_decode($conf, true);
- }else{
- $conf = [
- 'app_Key' => '',
- 'app_Secret' => '',
- ];
- }
- return $this->asJson([
- 'code'=>0,
- 'msg'=>'ok',
- 'data' => $conf,
- 'callbackLink' => \Yii::$app->request->hostInfo . '/index.php/jushuitan/callback',
- ]);
- }
- public function actionConfSave(){
- $conf = input_params('conf');
- if(!is_array($conf)){
- $conf = json_decode($conf, true);
- }
- Option::set(OptionSetting::JU_SHUI_TAN, json_encode($conf), 0, 'saas');
- return $this->asJson([
- 'code'=>0,
- 'msg'=>'保存成功'
- ]);
- }
- }
|