modified 添加JSON字符串验证

This commit is contained in:
zhaoxiang 2018-02-22 23:08:18 +08:00
parent b1aeed9bdc
commit 559d832b65

View File

@ -150,6 +150,9 @@ class Fields extends Base {
$jsonStr = $this->request->post('jsonStr');
$jsonStr = html_entity_decode($jsonStr);
$data = json_decode($jsonStr, true);
if ($data === null) {
return $this->buildFailed(ReturnCode::EXCEPTION, 'JSON数据格式有误');
}
ApiList::update(['returnStr' => json_encode($data)], ['hash' => $hash]);
$this->handle($data['data'], $dataArr);
$old = (new ApiFields())->where([