瀏覽代碼

更新安装程序,更新文件备注问题

evoxwht 2 年之前
父節點
當前提交
54f215456a
共有 2 個文件被更改,包括 11 次插入1 次删除
  1. 1 0
      crmeb/app/adminapi/controller/v1/system/SystemFile.php
  2. 10 1
      crmeb/public/install/index.php

+ 1 - 0
crmeb/app/adminapi/controller/v1/system/SystemFile.php

@@ -95,6 +95,7 @@ class SystemFile extends AuthController
             ['full_path', ''],
             ['mark', ''],
         ], true);
+        $full_path = $this->request->param('full_path');
         if ($full_path == '') return app('json')->fail(100100);
         $this->services->fileMarkSave($full_path, $mark);
         return app('json')->success(100000);

+ 10 - 1
crmeb/public/install/index.php

@@ -406,7 +406,16 @@ switch ($step) {
             $res = mysqli_query($conn, $addadminsql);
             $res2 = true;
             if (isset($_SERVER['SERVER_NAME'])) {
-                $site_url = '\'"http://' . $_SERVER['SERVER_NAME'] . '"\'';
+                if (isset($_SERVER['REQUEST_SCHEME'])) {
+                    $request_scheme = $_SERVER['REQUEST_SCHEME'];
+                } else {
+                    if ($_SERVER['HTTPS'] == 'on') {
+                        $request_scheme = 'https';
+                    } else {
+                        $request_scheme = 'http';
+                    }
+                }
+                $site_url = '\'"' . $request_scheme . '://' . $_SERVER['SERVER_NAME'] . '"\'';
                 $res2 = mysqli_query($conn, 'UPDATE `' . $dbPrefix . 'system_config` SET `value`=' . $site_url . ' WHERE `menu_name`="site_url"');
             }
             $arr = array('n' => 999999, 'count' => $counts, 'msg' => '安装完成', 'time' => date('Y-m-d H:i:s'));