The invention discloses a
JSON API dynamic
SQL generation method and
system, and the method comprises the following steps: (1) front-end
JSON data format agreement: a background
JSON API analyzes JSON data according to the JSON
data format agreement; and (2) a front-end JS
library packages a method for generating the JSON data, and when the front end triggers data persistence operation, such as newly adding, updating, querying and deleting, the data can be automatically generated according to the JSON agreement, and the data are sent to a background in an
AJAX POST mode; (3) firstly, a unified API entry of the background analyzes the JSON data, verifies whether the token is legal or not, and correlates and queries a
current user ID, a department ID, a role ID and the like; and (4) if the
authentication is not passed, prompt information is returned and given. After the
authentication is passed, the full path of the api method is analyzed, and if the full path of the api method is null, it is indicated that personalized logic
processing does not exist, and only conventional operation is performed on the data.