feat:增加菜谱后端接口
This commit is contained in:
@@ -2,6 +2,8 @@ import 'package:dio/dio.dart';
|
||||
import 'package:food_hub_app/utils/sp_util.dart';
|
||||
import 'package:food_hub_app/widgets/common/index.dart';
|
||||
|
||||
import 'log_util.dart';
|
||||
|
||||
class HttpUtil {
|
||||
static final HttpUtil _instance = HttpUtil._internal();
|
||||
|
||||
@@ -34,9 +36,9 @@ class HttpUtil {
|
||||
_dio.interceptors.add(
|
||||
InterceptorsWrapper(
|
||||
onRequest: (options, handler) {
|
||||
print("请求URL: ${options.uri}");
|
||||
logger.d("请求URL: ${options.uri}");
|
||||
if (options.data != null) {
|
||||
print("请求参数: ${options.data}");
|
||||
logger.d("请求参数: ${options.data}");
|
||||
}
|
||||
|
||||
if (SPUtil.getString('token').isNotEmpty) {
|
||||
@@ -51,8 +53,8 @@ class HttpUtil {
|
||||
_dio.interceptors.add(
|
||||
InterceptorsWrapper(
|
||||
onResponse: (response, handler) {
|
||||
print("响应状态码: ${response.statusCode}");
|
||||
print("响应数据: ${response.data}");
|
||||
logger.d("响应状态码: ${response.statusCode}");
|
||||
logger.d("响应数据: ${response.data}");
|
||||
return handler.next(response);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user