Commit 8590e1be125b13511cedb233b496982df34993f3
1 parent
764dd8bd
Exists in
v1.2
and in
2 other branches
..
Showing
3 changed files
with
14 additions
and
14 deletions
Show diff stats
API/DealyMessage.go
| ... | ... | @@ -31,8 +31,8 @@ func DealyMessageInfo(c *gin.Context) { |
| 31 | 31 | |
| 32 | 32 | if Token.GetToken(c.Query("UserId")) != c.Query("Token") { |
| 33 | 33 | c.JSON(200, tools.ResponseError{ |
| 34 | - 1, | |
| 35 | - "token不正确", | |
| 34 | + 401, | |
| 35 | + "token过期", | |
| 36 | 36 | }) |
| 37 | 37 | return |
| 38 | 38 | } |
| ... | ... | @@ -76,8 +76,8 @@ func CreateDealyMessage(c *gin.Context) { |
| 76 | 76 | |
| 77 | 77 | if Token.GetToken(c.PostForm("UserId")) != c.PostForm("Token") { |
| 78 | 78 | c.JSON(200, tools.ResponseError{ |
| 79 | - 1, | |
| 80 | - "token不正确", | |
| 79 | + 401, | |
| 80 | + "token过期", | |
| 81 | 81 | }) |
| 82 | 82 | return |
| 83 | 83 | } |
| ... | ... | @@ -124,8 +124,8 @@ func RemoveDealyMessage(c *gin.Context) { |
| 124 | 124 | |
| 125 | 125 | if Token.GetToken(c.PostForm("UserId")) != c.PostForm("Token") { |
| 126 | 126 | c.JSON(200, tools.ResponseError{ |
| 127 | - 1, | |
| 128 | - "token不正确", | |
| 127 | + 401, | |
| 128 | + "token过期", | |
| 129 | 129 | }) |
| 130 | 130 | return |
| 131 | 131 | } | ... | ... |
API/User.go
| ... | ... | @@ -121,8 +121,8 @@ func UserInfo(c *gin.Context) { |
| 121 | 121 | |
| 122 | 122 | if Token.GetToken(c.Query("id")) != c.Query("Token"){ |
| 123 | 123 | c.JSON(200, tools.ResponseError{ |
| 124 | - 1, | |
| 125 | - "token不正确", | |
| 124 | + 401, | |
| 125 | + "token过期", | |
| 126 | 126 | }) |
| 127 | 127 | return |
| 128 | 128 | } |
| ... | ... | @@ -146,7 +146,7 @@ func UserInfo(c *gin.Context) { |
| 146 | 146 | // @Param id aaron string true "用户id" |
| 147 | 147 | // @Param Token wgergejfwe string true "用户token" |
| 148 | 148 | // @Success 200 {object} tools.ResponseSeccess "{"errcode":0,"result":"ok"}" |
| 149 | -// @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" | |
| 149 | +// @Failure 500 {object} tools.ResponseError "{"errcode":401,"errmsg":"token过期"}" | |
| 150 | 150 | // @Router /CheckToken? [get] |
| 151 | 151 | func CheckToken(c *gin.Context) { |
| 152 | 152 | c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin")) |
| ... | ... | @@ -163,8 +163,8 @@ func CheckToken(c *gin.Context) { |
| 163 | 163 | |
| 164 | 164 | if Token.GetToken(c.Query("id")) != c.Query("Token"){ |
| 165 | 165 | c.JSON(200, tools.ResponseError{ |
| 166 | - 1, | |
| 167 | - "token不正确", | |
| 166 | + 401, | |
| 167 | + "token过期", | |
| 168 | 168 | }) |
| 169 | 169 | return |
| 170 | 170 | } |
| ... | ... | @@ -207,8 +207,8 @@ func UpdateUser(c *gin.Context) { |
| 207 | 207 | |
| 208 | 208 | if Token.GetToken(c.PostForm("id")) != c.PostForm("Token"){ |
| 209 | 209 | c.JSON(200, tools.ResponseError{ |
| 210 | - 1, | |
| 211 | - "token不正确", | |
| 210 | + 401, | |
| 211 | + "token过期", | |
| 212 | 212 | }) |
| 213 | 213 | return |
| 214 | 214 | } | ... | ... |
README.md
| ... | ... | @@ -149,7 +149,7 @@ |
| 149 | 149 | | Code | Type | Model | Message | |
| 150 | 150 | |-----|-----|-----|-----| |
| 151 | 151 | | 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | |
| 152 | -| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | | |
| 152 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":401,"errmsg":"token过期"} | | |
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | ... | ... |