|
@@ -31,16 +31,7 @@ type auth struct {
|
|
|
TypeIn int `json:"typein"`
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
func Auth(c *gin.Context) {
|
|
|
appG := app.Gin{C: c}
|
|
|
var reqInfo auth
|
|
@@ -51,7 +42,7 @@ func Auth(c *gin.Context) {
|
|
|
valid.MaxSize(reqInfo.Password, 100, "password").Message("最长为100字符")
|
|
|
valid.MinSize(reqInfo.Password, 1, "password").Message("不能为空")
|
|
|
valid.MinSize(reqInfo.Password, 1, "password").Message("不能为空")
|
|
|
- fmt.Println("==========reqInfo===========", reqInfo)
|
|
|
+
|
|
|
if valid.HasErrors() {
|
|
|
app.MarkErrors(valid.Errors)
|
|
|
appG.Response(http.StatusInternalServerError, e.ERROR_ADD_FAIL, valid.Errors)
|
|
@@ -60,7 +51,6 @@ func Auth(c *gin.Context) {
|
|
|
|
|
|
authService := user_service.User{Username: reqInfo.Username, Password: reqInfo.Password}
|
|
|
isExist, err := authService.Check()
|
|
|
- fmt.Println("==========Check===========", isExist, err)
|
|
|
if err != nil {
|
|
|
appG.Response(http.StatusInternalServerError, e.ERROR_AUTH_CHECK_TOKEN_FAIL, err)
|
|
|
return
|