jh-admin/addon/cos/shop/controller/Config.php

53 lines
1.7 KiB
PHP

<?php
/**
* SAAS应用系统 --- 十年开发经验汇集巨献!
* ==========================================================
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
* ----------------------------------------------------------
* 官方网址: https://www.zoomtk.com
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
* ==========================================================
*/
namespace addon\cos\shop\controller;
use app\shop\controller\BaseShop;
use addon\cos\model\Config as ConfigModel;
/**
* 腾讯上传管理
*/
class Config extends BaseShop
{
/**
* 云上传配置
* @return mixed
*/
public function config()
{
$config_model = new ConfigModel();
if (request()->isAjax()) {
$appid = input("appid", 0);
$SecretID = input("secretId", "");
$secret_key = input("secretKey", "");
$bucket = input("bucket", "");
$region = input("region", "");
$domain = input("domain", "");
$status = input("status", 0);
$data = array(
"appid" => $appid,
"secretId" => $SecretID,
"secretKey" => $secret_key,
"region" => $region,
"bucket" => $bucket,
"domain" => $domain,
);
$result = $config_model->setCosConfig($data, $status,$this->site_id,'shop');
return $result;
} else {
$info_result = $config_model->getCosConfig($this->site_id,'shop');
$info = $info_result["data"];
$this->assign("info", $info);
return $this->fetch("config/config");
}
}
}