From 32543f8cf5fe381cb66558a20517de50082e49fa Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Wed, 23 Mar 2022 12:16:50 +0800 Subject: [PATCH] udpate --- account.proto | 2 +- doc/login.md | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/account.proto b/account.proto index 02eb360..d141ac4 100644 --- a/account.proto +++ b/account.proto @@ -17,5 +17,5 @@ message LoginRsp { message Register { string phone = 1; // @inject_tag: binding:"required" string password = 2; // @inject_tag: binding:"required" - int32 code = 3; // @inject_tag: binding:"required" + string code = 3; // @inject_tag: binding:"required" } \ No newline at end of file diff --git a/doc/login.md b/doc/login.md index 094d45d..55d201d 100644 --- a/doc/login.md +++ b/doc/login.md @@ -35,8 +35,10 @@ $ curl --request POST 'http://192.168.0.206:8080/v1/register' \ ``` 返回结果: ```shell -{"code":0 ,"data":{"phone":"", "uid":"","password":""}} +{"code":0 ,"message":"success"}} ``` +* code = 0, 则成功 +* code != 0, 则注册失败,message是返回的提示信息 ### 登录接口 [/v1/login] 1. 说明:研发提供的接口必须遵循以下协议 @@ -68,8 +70,10 @@ $ curl --request POST 'http://192.168.0.206:8080/v1/login' \ ``` 返回结果: ```shell -{"code":0 ,"data":{"phone":"", "uid":"","password":""}} +{"code":0, "message":"success", "data":{"phone":"", "uid":"","password":""}} ``` +* code = 0, 成功,客户端解析data字段就行 +* code !=0, 失败, message字段是提示信息 -- libgit2 0.21.2