fix(redis): 修复 Redis 流读取兼容性问题
- 支持 bytes 和 str 类型的 entry_id - 支持 list 类型响应格式 - 优化 payload 解码处理
This commit is contained in:
@@ -38,6 +38,10 @@ class ApiClient implements IApiClient {
|
||||
|
||||
Dio get dio => _dio;
|
||||
|
||||
void resetInterceptor() {
|
||||
_interceptor.reset();
|
||||
}
|
||||
|
||||
void setRefreshCallback(Future<bool> Function(String) refresh) {
|
||||
_interceptor.onTokenRefresh = () async {
|
||||
final token = await _tokenStorage.getRefreshToken();
|
||||
@@ -102,10 +106,7 @@ class ApiClient implements IApiClient {
|
||||
try {
|
||||
final response = await _dio.get<ResponseBody>(
|
||||
path,
|
||||
options: Options(
|
||||
responseType: ResponseType.stream,
|
||||
headers: headers,
|
||||
),
|
||||
options: Options(responseType: ResponseType.stream, headers: headers),
|
||||
);
|
||||
final responseBody = response.data;
|
||||
if (responseBody == null) {
|
||||
|
||||
@@ -98,4 +98,9 @@ class ApiInterceptor extends Interceptor {
|
||||
return refreshed;
|
||||
});
|
||||
}
|
||||
|
||||
void reset() {
|
||||
_refreshFuture = null;
|
||||
_refreshBlockedUntil = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user