Commit c7d9fb26 authored by 张宏's avatar 张宏

http移动

parent 76a57f12
...@@ -7,7 +7,7 @@ import 'package:smart_hotel_app/blocs/auth/auth_state.dart'; ...@@ -7,7 +7,7 @@ import 'package:smart_hotel_app/blocs/auth/auth_state.dart';
import 'package:smart_hotel_app/routes/app_router.dart'; import 'package:smart_hotel_app/routes/app_router.dart';
import 'package:smart_hotel_app/repositories/auth_repository.dart'; import 'package:smart_hotel_app/repositories/auth_repository.dart';
import 'package:smart_hotel_app/services/auth_service.dart'; import 'package:smart_hotel_app/services/auth_service.dart';
import 'package:smart_hotel_app/http/dio_request.dart'; import 'package:smart_hotel_app/utils/http/dio_request.dart';
import 'package:smart_hotel_app/utils/event_bus.dart'; import 'package:smart_hotel_app/utils/event_bus.dart';
import 'package:smart_hotel_app/utils/storage/storage_service.dart'; import 'package:smart_hotel_app/utils/storage/storage_service.dart';
import 'package:smart_hotel_app/routes/app_router.gr.dart'; import 'package:smart_hotel_app/routes/app_router.gr.dart';
......
import '../http/response_model.dart'; import '../utils/http/response_model.dart';
import '../http/dio_request.dart'; import '../utils/http/dio_request.dart';
class AuthRepository { class AuthRepository {
Future<ResponseModel> login(Map<String, dynamic> params) { Future<ResponseModel> login(Map<String, dynamic> params) {
......
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import '../utils/constants.dart'; import '../constants.dart';
import 'exceptions/app_exception.dart'; import 'exceptions/app_exception.dart';
import 'interceptors/error_interceptor.dart'; import 'interceptors/error_interceptor.dart';
import 'interceptors/request_interceptor.dart'; import 'interceptors/request_interceptor.dart';
import 'interceptors/response_interceptor.dart'; import 'interceptors/response_interceptor.dart';
import '../utils/storage/storage_service.dart'; import '../storage/storage_service.dart';
import 'response_model.dart'; import 'response_model.dart';
class DioRequest { class DioRequest {
...@@ -374,4 +374,4 @@ class DioRequest { ...@@ -374,4 +374,4 @@ class DioRequest {
const chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
return List.generate(length, (index) => chars[index % chars.length]).join(); return List.generate(length, (index) => chars[index % chars.length]).join();
} }
} }
\ No newline at end of file
...@@ -13,4 +13,4 @@ class AppException implements Exception { ...@@ -13,4 +13,4 @@ class AppException implements Exception {
String toString() { String toString() {
return 'AppException: $message (code: $code, uuid: $uuid)'; return 'AppException: $message (code: $code, uuid: $uuid)';
} }
} }
\ No newline at end of file
...@@ -6,4 +6,4 @@ class BusinessException extends AppException { ...@@ -6,4 +6,4 @@ class BusinessException extends AppException {
int? code, int? code,
String? uuid, String? uuid,
}) : super(message: message, code: code, uuid: uuid); }) : super(message: message, code: code, uuid: uuid);
} }
\ No newline at end of file
...@@ -5,4 +5,4 @@ class CancelException extends AppException { ...@@ -5,4 +5,4 @@ class CancelException extends AppException {
String message = '请求已取消', String message = '请求已取消',
String? uuid, String? uuid,
}) : super(message: message, code: -1, uuid: uuid); }) : super(message: message, code: -1, uuid: uuid);
} }
\ No newline at end of file
...@@ -6,4 +6,4 @@ class NetworkException extends AppException { ...@@ -6,4 +6,4 @@ class NetworkException extends AppException {
int? code, int? code,
String? uuid, String? uuid,
}) : super(message: message, code: code, uuid: uuid); }) : super(message: message, code: code, uuid: uuid);
} }
\ No newline at end of file
...@@ -6,4 +6,4 @@ class ServerException extends AppException { ...@@ -6,4 +6,4 @@ class ServerException extends AppException {
int? code, int? code,
String? uuid, String? uuid,
}) : super(message: message, code: code, uuid: uuid); }) : super(message: message, code: code, uuid: uuid);
} }
\ No newline at end of file
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import '../../utils/event_bus.dart'; import '../../event_bus.dart';
import '../exceptions/app_exception.dart'; import '../exceptions/app_exception.dart';
import '../exceptions/business_exception.dart'; import '../exceptions/business_exception.dart';
import '../exceptions/cancel_exception.dart'; import '../exceptions/cancel_exception.dart';
...@@ -137,4 +137,4 @@ class ErrorInterceptor extends Interceptor { ...@@ -137,4 +137,4 @@ class ErrorInterceptor extends Interceptor {
} }
print('========== Error END =========='); print('========== Error END ==========');
} }
} }
\ No newline at end of file
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import '../../utils/storage/storage_service.dart'; import '../../storage/storage_service.dart';
class RequestInterceptor extends Interceptor { class RequestInterceptor extends Interceptor {
final StorageService _storageService; final StorageService _storageService;
...@@ -54,4 +54,4 @@ class RequestInterceptor extends Interceptor { ...@@ -54,4 +54,4 @@ class RequestInterceptor extends Interceptor {
} }
print('========== Request END =========='); print('========== Request END ==========');
} }
} }
\ No newline at end of file
...@@ -17,4 +17,4 @@ class ResponseInterceptor extends Interceptor { ...@@ -17,4 +17,4 @@ class ResponseInterceptor extends Interceptor {
print('Data: ${response.data}'); print('Data: ${response.data}');
print('========== Response END =========='); print('========== Response END ==========');
} }
} }
\ No newline at end of file
...@@ -81,4 +81,4 @@ class ResponseModel<T> { ...@@ -81,4 +81,4 @@ class ResponseModel<T> {
String toString() { String toString() {
return 'ResponseModel(code: $code, msg: $msg, uuid: $uuid, success: $success)'; return 'ResponseModel(code: $code, msg: $msg, uuid: $uuid, success: $success)';
} }
} }
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment