chengkun
2025-04-24 5d55579fd424e024c52e62265b72e24c38a45004
admin/model/config.class.php
@@ -9,13 +9,14 @@
 *
 * 软件声明:未经授权前提下,不得用于商业运营、二次开发以及任何形式的再次发布。
 */
class config_controller extends adminCommon{
    /**
     * 系统-网站设置
     */
    function index_action(){
        if (strpos($this->config['sy_weburl'], 'https') !== false) {
        if (strpos($this->config['sy_weburl'], 'https') !== FALSE) {
            
            $this->config['mapurl'] = 'https://api.map.baidu.com/api?v=2.0&ak=' . $this->config['map_key'] . '&s=1';
        } else {
@@ -45,6 +46,7 @@
    // 保存
    function save_action(){
//       var_dump($_POST);exit;
        if ($_POST['config']) {
            
            if ($_POST['config'] == 'uploadconfig'){
@@ -96,7 +98,7 @@
            unset($_POST['config']);
            unset($_POST['pytoken']);
            if (isset($_POST['map_key'])) {
                if (strpos($this->config['sy_weburl'], 'https') !== false) {
                if (strpos($this->config['sy_weburl'], 'https') !== FALSE) {
                    
                    $_POST['mapurl'] = 'https://api.map.baidu.com/api?v=2.0&ak=' . $_POST['map_key'] . '&s=1';
                } else {
@@ -105,7 +107,7 @@
            }
            if (!empty($_POST['sy_weburl'])) {
                $weburl = trim($_POST['sy_weburl']);
                if (stripos($weburl, 'http') === false){
                if (stripos($weburl, 'http') === FALSE) {
                    $this->layer_msg('网站地址缺少http://或https://', 8, 1, '');
                }
                // 保存域名时,相关的内容要重新保存,防止域名或http头改变后,有关功能异常
@@ -191,9 +193,9 @@
    // 开启sphinx时,检查searchd是否运行,生成sphinx.conf配置文件
    function check_usesphinx_action(){
        include_once (LIB_PATH . "sphinx.class.php");
        $useSphinx = false;
        $useSphinx = FALSE;
        if (sphinx::isRun($this->config['sphinxhost'], $this->config['sphinxport'])) {
            $useSphinx = true;
            $useSphinx = TRUE;
        }
        
        if ($useSphinx) {
@@ -240,9 +242,9 @@
        echo '1';
        exit();
    }
    //后台专用,layui上传图片公共方法
    function layui_upload_action()
    {
    function layui_upload_action() {
        
        if($_FILES['file']['tmp_name']){
@@ -272,4 +274,5 @@
        echo json_encode($return);
    }
}
?>