抖动dio缓存如何使用加密和解密

时间:2020-07-21 10:52:13

标签: flutter dio

我正在尝试在抖动dio缓存中使用加密 但我不知道需要参数加密吗? 请提供帮助

var _dio = Dio();
var _dioCacheManager = new DioCacheManager(CacheConfig(baseUrl: apiurl, encrypt: myEncrypt));

_dio.interceptors.add(_dioCacheManager.interceptor);

var response = await _dio.post("${apiurl}",
    data: param,
    options: buildCacheOptions(customDuration ?? Duration(hours: 6),
        maxStale: customMaxStale ?? Duration(hours: 6),
    ));

Future<List<int>> myEncrypt(data){

  List<int> mockupList = [1, 2];

  return mockupList;
}

0 个答案:

没有答案