public function actions() { $return = []; $module_token = Yii::$app->request->post('module_token'); $this_module_token = \fec\helpers\CModule::getToken(); if ($module_token != $this_module_token) { $return['ack'] = false; $return['ack_description'] = "modules token is not right"; $return['content'] = $module_token . '#' . $this_module_token; echo json_encode($return); exit; } $r = $this->getControllerAndAction(); $t_controller = $r['controller']; $t_action = $r['action']; $current_remote_function_param_array = Yii::$app->request->post('current_remote_function_param_array'); $current_remote_function_param_array = unserialize($current_remote_function_param_array); $param = !empty($current_remote_function_param_array) && is_array($current_remote_function_param_array) ? $current_remote_function_param_array : []; $current_namespace = $this->_name_space; $module_o_dir = str_replace("\\controllers", "\\o", $current_namespace); $function_exec = $module_o_dir . "\\" . $t_controller . "::" . $t_action; $data = \call_user_func_array($function_exec, $param); $data = json_decode($data); $return['ack'] = true; $return['ack_description'] = "success"; $return['content'] = $data; # 把模块更新的session更新到redis上面,以供其他模块使用 session_commit(); echo json_encode($return); exit; }