FlutterDioError [DioError类型响应]:HTTP状态错误[403]

qlvxas9a  于 2022-12-24  发布在  Flutter
关注(0)|答案(1)|浏览(724)

我得到了这样的按摩:
[错误:flutter/lib/ui/ui_dart_state. cc(198)]未处理的异常:DioError [DioError类型响应]:HTTP状态错误[403]
下面是loginCall方法:

Future<LoginModel?> loginCall(
    String email,
    String password,
  ) async {
    Map<String, dynamic> json = {"email": email, "hashPass": password};
    var response = await dio.post(baseUrl + "login", data: json);
    print(response.data);
    print(response.statusCode);

    if (response.statusCode == 200) {
      var result = LoginModel.fromJson(response.data);
      print("gelen response: ${response.data}");
      return result;
    } else {
      throw Exception("Error! ${response.statusCode}");
    }
  }
1qczuiv0

1qczuiv01#

错误403通常意味着未授权。2因此,您可能输入了不正确的电子邮件和密码组合。

相关问题