diff --git a/middleware/student.go b/middleware/student.go index 06cad6a..bc7a54e 100644 --- a/middleware/student.go +++ b/middleware/student.go @@ -60,7 +60,7 @@ func GetUserInfo(redisClient *redis.Storage) fiber.Handler { var result map[string]interface{} json.Unmarshal(body, &result) fmt.Println(result) - if _, ok := result["code"]; !ok || int(result["code"].(float64)) != 1 { + if _, ok := result["code"]; !ok || result["code"].(int) != 1 { return c.Status(http.StatusUnauthorized).JSON(fiber.Map{ "message": "获取学生信息失败,身份证无效", "error": "身份证无效",