getPicUrl function

Future<String> getPicUrl(
  1. String loginFlag
)

Implementation

Future<String> getPicUrl(String loginFlag) async {
  final dio = Dio();
  late String url;
  String reqUrl =
      "https://${Config.iotManagerHttpIp}/wxLogin/getLoginPic?loginFlag=$loginFlag";
  final response = await dio.get(reqUrl);
  if (response.data["code"] == 0) {
    String ticket = response.data["data"]["ticket"];
    url = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=$ticket";
    return url;
  } else {
    return "";
  }
}