The understanding of the value 1 or 0 of "code" in the json returned by the backend interface.

in the separation of front and rear ends, and in the design of back-end interfaces, such as

{
    "code":1,
    "data":{}
}
The value of

code, 1 means that the request succeeded or failed in response to the code request? Look at several demo, is set 0 as successful. How do you make it?


this had better follow the response status of http to indicate the status
https://developer.mozilla.org.


. The reason why 0 is set to success is mainly because the c function returns 0 means successful execution, which is a problem left over by history. You can also set 200 to succeed, just like http status.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b325e0-2be25.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b325e0-2be25.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?