异常描述

http 包返回中文乱码问题

解决方案

在使用http 包时,返回结果的中文是乱码,需要多一层解码

final response = await _httpClient.post(
      Uri.parse("${HttpConfig.apiUrl}auth/login"),
      headers: {"Content-Type": "application/json"},
      body: jsonEncode(passwordLogin.toJson()),
    );
final result = Result.fromJson(jsonDecode(const Utf8Decoder().convert(response.bodyBytes)));