处理bug
This commit is contained in:
parent
bcd0aa73c0
commit
db421ccee5
|
|
@ -96,7 +96,7 @@ class Savemsg extends Base{
|
||||||
|
|
||||||
public function save_box_msg($data = ['sn_code_all'=>'564654564654654,564654564654654','box_serial_number'=>'996589585']){
|
public function save_box_msg($data = ['sn_code_all'=>'564654564654654,564654564654654','box_serial_number'=>'996589585']){
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
// 你的业务逻辑
|
// 你的业务逻辑
|
||||||
if(count(input('post.')) > 0){
|
if(count(input('post.')) > 0){
|
||||||
$data = input('post.');
|
$data = input('post.');
|
||||||
|
|
@ -115,22 +115,22 @@ class Savemsg extends Base{
|
||||||
}
|
}
|
||||||
$result = $this->save_box_msg_action($data);
|
$result = $this->save_box_msg_action($data);
|
||||||
return $result;
|
return $result;
|
||||||
} catch (\Exception $e) {
|
// } catch (\Exception $e) {
|
||||||
// 捕获异常
|
// // 捕获异常
|
||||||
$logContent["flie"] = $e->getFile();
|
// $logContent["flie"] = $e->getFile();
|
||||||
$logContent["line"] = $e->getLine();
|
// $logContent["line"] = $e->getLine();
|
||||||
$logContent['all_content'] = "异常信息:\n";
|
// $logContent['all_content'] = "异常信息:\n";
|
||||||
$logContent['all_content'] .= "消息: " . $e->getMessage() . "\n";
|
// $logContent['all_content'] .= "消息: " . $e->getMessage() . "\n";
|
||||||
$logContent['all_content'] .= "代码: " . $e->getCode() . "\n";
|
// $logContent['all_content'] .= "代码: " . $e->getCode() . "\n";
|
||||||
$logContent['all_content'] .= "文件: " . $e->getFile() . "\n";
|
// $logContent['all_content'] .= "文件: " . $e->getFile() . "\n";
|
||||||
$logContent['all_content'] .= "函数名: " . __FUNCTION__ . "\n";
|
// $logContent['all_content'] .= "函数名: " . __FUNCTION__ . "\n";
|
||||||
$logContent['all_content'] .= "行号: " . $e->getLine() . "\n";
|
// $logContent['all_content'] .= "行号: " . $e->getLine() . "\n";
|
||||||
$logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n";
|
// $logContent['all_content'] .= "跟踪信息:\n" . $e->getTraceAsString() . "\n";
|
||||||
// dump($data);
|
// // dump($data);
|
||||||
// die;
|
// // die;
|
||||||
$this->record_api_log($data, $logContent, null);
|
// $this->record_api_log($data, $logContent, null);
|
||||||
return $this->msg(99999);
|
// return $this->msg(99999);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -345,7 +345,7 @@ class Savemsg extends Base{
|
||||||
|
|
||||||
|
|
||||||
public function chuli_str_kongbai($data){
|
public function chuli_str_kongbai($data){
|
||||||
foreach ($$data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
// 1. 移除所有空字符和不可见字符
|
// 1. 移除所有空字符和不可见字符
|
||||||
$data[$key] = preg_replace('/[\x00-\x1F\x7F]/', '', $value);
|
$data[$key] = preg_replace('/[\x00-\x1F\x7F]/', '', $value);
|
||||||
// 2. 去除首尾空白
|
// 2. 去除首尾空白
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue