stanley-king il y a 1 an
Parent
commit
957e8d3fe8

+ 2 - 2
docker/compose/homecuda/cpenv

@@ -1,10 +1,10 @@
 #!/bin/bash
 
 # shellcheck disable=SC2039
-dest_dirs=("macc" "admin" "vendor" "cli" "cluster" "master-crond" "racc" "slave-crond" "worker")
+dest_dirs=("macc" "admin" "vendor" "cli" "cluster" "master" "racc" "slave" "worker")
 src_file=".env"
 
 for dir in "${dest_dirs[@]}"; do
     cp "$src_file" "$dir/"
     echo "$dir/"
-done
+done

+ 2 - 3
helper/fcgisrv/RAccServer.php

@@ -75,19 +75,18 @@ class RAccServer extends BaseServer
     {
         try
         {
-            Log::record("file is {$file}",Log::DEBUG);
+            fcgi_header("Content-Type: text/html; charset=UTF-8");
             if(file_exists($file))
             {
                 if($this->is_exclude($file)) {
-                    Log::record("Call $file", Log::DEBUG);
                     include $file;
                 } else {
                     Base::mobile_control();
                 }
+                session::instance()->end(false);
             }
             else
             {
-                fcgi_header("Content-Type: text/html; charset=UTF-8");
                 echo "no such file.";
             }
         }

+ 58 - 1
racc/framework/function/function.php

@@ -5,5 +5,62 @@
  * 公共方法
  *
  */
-
 defined('InShopNC') or exit('Access Invalid!');
+
+
+require_once(BASE_CORE_PATH . '/framework/libraries/model.php');
+require_once(BASE_DATA_PATH . '/model/member.model.php');
+require_once(BASE_HELPER_PATH . '/errcode.php');
+
+function joutput_data($datas,$type='')
+{
+    $data = [];
+
+    $code = errcode::Success;
+    $data['code'] = $code;
+    $data['message'] = errcode::msg($code);
+
+    $data['datas'] = $datas;
+
+    if($_SESSION['client_type'] != 'ajax')
+    {
+        $contents = ob_get_clean();
+        if(!empty($contents)) {
+            Log::record($contents,Log::ERR);
+        }
+        ob_start();
+    }
+
+    if(!empty($type) && $type == 'web') {
+        echo(json_encode($data,JSON_UNESCAPED_UNICODE));
+    } else {
+        echo(json_encode($data));
+    }
+}
+
+function joutput_error($code,$message = '',$type='')
+{
+    if(empty($message)) {
+        $message = errcode::msg($code);
+    }
+
+    $data = [];
+    $data['code'] = $code;
+    $data['message'] =  $message;
+    $data['datas'] = [];
+
+    if($_SESSION['client_type'] != 'ajax')
+    {
+        $contents = ob_get_clean();
+        if(!empty($contents)) {
+            Log::record($contents,Log::ERR);
+        }
+        ob_start();
+    }
+    Log::record("code = {$code} message = {$message}",Log::ERR);
+    if(!empty($type) && $type == 'web') {
+        echo(json_encode($data,JSON_UNESCAPED_UNICODE));
+    } else {
+        echo(json_encode($data,JSON_UNESCAPED_UNICODE));
+    }
+}