From a73f2974e175f89448311a80567a8618b8e57fd9 Mon Sep 17 00:00:00 2001 From: orz12 Date: Tue, 23 Jan 2024 15:11:48 +0800 Subject: [PATCH] fix: typo --- lib/http/api.dart | 2 +- lib/http/interceptor.dart | 4 ++-- lib/http/search.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/http/api.dart b/lib/http/api.dart index 1731519b..532ca341 100644 --- a/lib/http/api.dart +++ b/lib/http/api.dart @@ -185,7 +185,7 @@ class Api { static const String searchDefault = '/x/web-interface/wbi/search/default'; // 搜索关键词 - static const String serachSuggest = + static const String searchSuggest = 'https://s.search.bilibili.com/main/suggest'; // 分类搜索 diff --git a/lib/http/interceptor.dart b/lib/http/interceptor.dart index 68f5742d..48ba7e60 100644 --- a/lib/http/interceptor.dart +++ b/lib/http/interceptor.dart @@ -70,14 +70,14 @@ class ApiInterceptor extends Interceptor { case DioExceptionType.sendTimeout: return '发送请求超时,请检查网络设置'; case DioExceptionType.unknown: - final String res = await checkConect(); + final String res = await checkConnect(); return '$res \n 网络异常,请稍后重试!'; // default: // return 'Dio异常'; } } - static Future checkConect() async { + static Future checkConnect() async { final ConnectivityResult connectivityResult = await Connectivity().checkConnectivity(); if (connectivityResult == ConnectivityResult.mobile) { diff --git a/lib/http/search.dart b/lib/http/search.dart index 7239f435..18481ea8 100644 --- a/lib/http/search.dart +++ b/lib/http/search.dart @@ -36,7 +36,7 @@ class SearchHttp { // 获取搜索建议 static Future searchSuggest({required term}) async { - var res = await Request().get(Api.serachSuggest, + var res = await Request().get(Api.searchSuggest, data: {'term': term, 'main_ver': 'v1', 'highlight': term}); if (res.data is String) { Map resultMap = json.decode(res.data);