增加code: 0的回报数据

This commit is contained in:
wang_chengh 2023-09-20 15:36:23 +08:00
parent a055327bd7
commit 86491da7cf
1 changed files with 1 additions and 0 deletions

View File

@ -79,6 +79,7 @@ int main() {
if ((row = mysql_fetch_row(res))) { if ((row = mysql_fetch_row(res))) {
cJSON_AddNumberToObject(result_json, "code", 0); cJSON_AddNumberToObject(result_json, "code", 0);
cJSON_AddStringToObject(result_json, "nickname", "admin");
} else { } else {
cJSON_AddNumberToObject(result_json, "code", 1); cJSON_AddNumberToObject(result_json, "code", 1);
cJSON_AddStringToObject(result_json, "msg", "用户名或口令错误"); cJSON_AddStringToObject(result_json, "msg", "用户名或口令错误");