|
|
@@ -60,12 +60,17 @@ class GetWeather(APIView):
|
|
|
cursor = conn.cursor()
|
|
|
username = data.get("username")
|
|
|
password = data.get("password")
|
|
|
- sql = """
|
|
|
- select * from user where username = ? and password = ?
|
|
|
- """
|
|
|
- cursor.execute(sql, (username, password,))
|
|
|
- user = cursor.fetchone()
|
|
|
- if not user:
|
|
|
+ # sql = """
|
|
|
+ # select * from user where username = ? and password = ?
|
|
|
+ # """
|
|
|
+ # cursor.execute(sql, (username, password,))
|
|
|
+ # user = cursor.fetchone()
|
|
|
+ user_info = {
|
|
|
+ "admin001": "why123456",
|
|
|
+ "admin001": " yf@mtg",
|
|
|
+ "fujinsuyuan": "yf@fj"
|
|
|
+ }
|
|
|
+ if not (user_info.get(username) == password):
|
|
|
return Response({"msg":"认证失败", "code": 400})
|
|
|
table = "day_data" if day_type == "1" else "serven_day_data"
|
|
|
table = "day_data" if day_type == "1" else "server_day_data"
|