Browse Source

登录注册与用户信息的接口

liukai 3 months ago
parent
commit
4427c70e28
61 changed files with 1586 additions and 784 deletions
  1. 2 5
      app/lib/modules/splash/vm/splash_view_model.dart
  2. 11 0
      packages/cpt_auth/lib/modules/auth_login/auth_login_page.dart
  3. 21 7
      packages/cpt_auth/lib/modules/auth_login/auth_login_view_model.dart
  4. 1 1
      packages/cpt_auth/lib/modules/auth_login/auth_login_view_model.g.dart
  5. 1 1
      packages/cpt_auth/lib/modules/select_estate/select_estate_view_model.g.dart
  6. 1 1
      packages/cpt_auth/lib/modules/select_unit/select_unit_view_model.g.dart
  7. 23 7
      packages/cpt_auth/lib/modules/sign_up/sign_up_view_model.dart
  8. 1 1
      packages/cpt_auth/lib/modules/sign_up/sign_up_view_model.g.dart
  9. 6 5
      packages/cpt_auth/lib/modules/sing_up_success/sign_up_success_page.dart
  10. 1 1
      packages/cpt_auth/lib/modules/sing_up_success/sign_up_success_view_model.g.dart
  11. 80 13
      packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_page.dart
  12. 26 4
      packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_state.dart
  13. 102 4
      packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_view_model.dart
  14. 1 1
      packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_view_model.g.dart
  15. 5 0
      packages/cpt_auth/lib/router/component/auth_component_service.dart
  16. 75 5
      packages/cpt_auth/lib/router/page/auth_page_router.gr.dart
  17. 0 280
      packages/cpt_main/lib/modules/demo_page.dart
  18. 1 1
      packages/cpt_main/lib/modules/feedback/create/feedback_create_view_model.g.dart
  19. 0 1
      packages/cpt_main/lib/modules/feedback/create_success/feedback_create_success_page.dart
  20. 0 1
      packages/cpt_main/lib/modules/feedback/detail/feedback_detail_page.dart
  21. 0 1
      packages/cpt_main/lib/modules/feedback/item_feedback.dart
  22. 1 8
      packages/cpt_main/lib/modules/home/home_page.dart
  23. 10 47
      packages/cpt_main/lib/modules/main/main_page.dart
  24. 15 6
      packages/cpt_main/lib/modules/main/main_view_model.dart
  25. 1 1
      packages/cpt_main/lib/modules/main/main_view_model.g.dart
  26. 15 10
      packages/cpt_main/lib/modules/me/me_page.dart
  27. 1 1
      packages/cpt_main/lib/modules/me/me_view_model.dart
  28. 1 1
      packages/cpt_main/lib/modules/me/me_view_model.g.dart
  29. 0 2
      packages/cpt_main/lib/modules/notification/item_notification.dart
  30. 0 1
      packages/cpt_main/lib/modules/visitor/item_visitor.dart
  31. 1 0
      packages/cpt_profile/lib/modules/change_mobile/change_mobile_view_model.dart
  32. 13 5
      packages/cpt_profile/lib/modules/setting/setting_view_model.dart
  33. 17 277
      packages/cs_domain/lib/constants/api_constants.dart
  34. 22 0
      packages/cs_domain/lib/entity/auth_login_entity.dart
  35. 22 0
      packages/cs_domain/lib/entity/captcha_img_entity.dart
  36. 135 0
      packages/cs_domain/lib/entity/user_me_entity.dart
  37. 40 0
      packages/cs_domain/lib/generated/json/auth_login_entity.g.dart
  38. 42 14
      packages/cs_domain/lib/generated/json/base/json_convert_content.dart
  39. 40 0
      packages/cs_domain/lib/generated/json/captcha_img_entity.g.dart
  40. 352 0
      packages/cs_domain/lib/generated/json/user_me_entity.g.dart
  41. 147 0
      packages/cs_domain/lib/repository/auth_repository.dart
  42. 27 0
      packages/cs_domain/lib/repository/auth_repository.g.dart
  43. 30 0
      packages/cs_domain/lib/repository/main_repository.dart
  44. 27 0
      packages/cs_domain/lib/repository/main_repository.g.dart
  45. 45 0
      packages/cs_domain/lib/repository/profile_repository.dart
  46. 27 0
      packages/cs_domain/lib/repository/profile_repository.g.dart
  47. 5 3
      packages/cs_plugin_basic/lib/constants/app_constant.dart
  48. 19 18
      packages/cs_widgets/lib/dialog/verify_code_dialog.dart
  49. 24 0
      packages/cs_plugin_basic/lib/dialog/verify_code_state.dart
  50. 63 0
      packages/cs_plugin_basic/lib/dialog/verify_code_view_model.dart
  51. 4 1
      packages/cs_plugin_basic/lib/dio_interceptors/interceptor_auth_dio.dart
  52. 6 30
      packages/cs_plugin_basic/lib/provider/user_config/user_config.dart
  53. 20 6
      packages/cs_plugin_basic/lib/provider/user_config/user_config_service.dart
  54. 9 11
      packages/cs_plugin_platform/lib/http/dio/dio_cancelable_mixin.dart
  55. 5 0
      packages/cs_resources/lib/generated/intl/messages_en.dart
  56. 30 0
      packages/cs_resources/lib/generated/l10n.dart
  57. 3 0
      packages/cs_resources/lib/l10n/intl_en.arb
  58. 3 0
      packages/cs_resources/lib/l10n/intl_zh_CN.arb
  59. 3 0
      packages/cs_resources/lib/l10n/intl_zh_HK.arb
  60. 2 0
      packages/cs_router/lib/componentRouter/auth_service.dart
  61. 1 2
      packages/cs_widgets/lib/widget_export.dart

+ 2 - 5
app/lib/modules/splash/vm/splash_view_model.dart

@@ -47,18 +47,15 @@ class SplashViewModel extends _$SplashViewModel {
     // String routerName = await AppChannel.getNativeRouterName();
     // Log.d('SplashController - 查询原生平台有没有保存需要跳转的子路由:$routerName');
 
-    String? token = SPUtil.getString(AppConstant.storageToken);
-    final userConfigService = UserConfigService.getInstance();
-    userConfigService.setToken(token);
+    UserConfigService.getInstance();
 
     if (UserConfigService.getState().haslogin == true) {
-      //去Attendance页面签到
       Log.d("已经登录,去首页页面");
       ComponentServiceManager().mainService.startMainPage();
     } else {
       //去登录页面
       Log.d("没有登录,去登录页面");
-      ComponentServiceManager().mainService.startMainPage();
+      ComponentServiceManager().authService.startAndPopAllLoginPage();
     }
   }
 }

+ 11 - 0
packages/cpt_auth/lib/modules/auth_login/auth_login_page.dart

@@ -35,6 +35,17 @@ class AuthLoginPage extends HookConsumerWidget {
     }
   }
 
+  //替换之前的页面
+  static void startAndPopAll({BuildContext? context}) {
+    if (context != null) {
+      context.router.popUntilRoot();
+      context.router.replace(const AuthLoginPageRoute());
+    } else {
+      appRouter.popUntilRoot();
+      appRouter.replace(const AuthLoginPageRoute());
+    }
+  }
+
   @override
   Widget build(BuildContext context, WidgetRef ref) {
     final viewModel = ref.read(authLoginViewModelProvider.notifier);

+ 21 - 7
packages/cpt_auth/lib/modules/auth_login/auth_login_view_model.dart

@@ -1,7 +1,12 @@
 import 'package:cpt_auth/modules/sign_up/sign_up_page.dart';
+import 'package:domain/repository/auth_repository.dart';
 import 'package:flutter/material.dart';
+import 'package:plugin_basic/constants/app_constant.dart';
+import 'package:plugin_basic/provider/user_config/user_config_service.dart';
+import 'package:plugin_platform/engine/notify/notify_engine.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:router/componentRouter/component_service_manager.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:shared/utils/util.dart';
 
@@ -12,10 +17,13 @@ part 'auth_login_view_model.g.dart';
 
 @riverpod
 class AuthLoginViewModel extends _$AuthLoginViewModel {
+  late final AuthRepository authRepository;
+
   @override
   LoginState build() {
-    final state = LoginState();
+    authRepository = ref.read(authRepositoryProvider);
 
+    final state = LoginState();
     initListener(state);
     ref.onDispose(() {
       onDispose(state);
@@ -29,7 +37,7 @@ class AuthLoginViewModel extends _$AuthLoginViewModel {
   }
 
   //执行用户的登录
-  void doLogin() {
+  void doLogin() async {
     state = state.copyWith(accountErrorText: null, passwordErrorText: null);
 
     final FocusNode accountFocusNode = state.formData['account']!['focusNode'];
@@ -43,7 +51,7 @@ class AuthLoginViewModel extends _$AuthLoginViewModel {
     final account = accountController.text;
     final password = passwordController.text;
 
-    Log.d('当前待提交的 账号:${account} password:${password}');
+    Log.d('当前待提交的 账号:$account password:$password');
 
     if (Utils.isEmpty(account)) {
       state = state.copyWith(accountErrorText: "Phone/Email cannot be empty!");
@@ -55,8 +63,15 @@ class AuthLoginViewModel extends _$AuthLoginViewModel {
       return;
     }
 
-    //执行密码登录
-    ToastEngine.show('准备执行请求 账号:${account} password:${password}');
+    final result = await authRepository.authLogin(AppConstant.countryCode + account, password);
+
+    //请求成功去首页
+    if (result.isSuccess) {
+      UserConfigService.getInstance().setToken(result.data?.token);
+      ComponentServiceManager().mainService.startMainPage();
+    } else {
+      ToastEngine.show(result.errorMsg ?? "UnKnow Error");
+    }
   }
 
   //去协议页面
@@ -75,7 +90,7 @@ class AuthLoginViewModel extends _$AuthLoginViewModel {
   }
 
   //切换同意按钮
-  void switchAgreeTerms(){
+  void switchAgreeTerms() {
     state = state.copyWith(isAgreeTerms: !state.isAgreeTerms);
   }
 
@@ -127,5 +142,4 @@ class AuthLoginViewModel extends _$AuthLoginViewModel {
     passwordController.dispose();
     Log.d("LoginViewModel 销毁 onDispose");
   }
-
 }

+ 1 - 1
packages/cpt_auth/lib/modules/auth_login/auth_login_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'auth_login_view_model.dart';
 // **************************************************************************
 
 String _$authLoginViewModelHash() =>
-    r'45f0dfb96b894b4df90cd94bbd921c26344d3a96';
+    r'afff62eb84d983159db7ca8c4d7b1a9dde73ce08';
 
 /// See also [AuthLoginViewModel].
 @ProviderFor(AuthLoginViewModel)

+ 1 - 1
packages/cpt_auth/lib/modules/select_estate/select_estate_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'select_estate_view_model.dart';
 // **************************************************************************
 
 String _$selectEstateViewModelHash() =>
-    r'44d0829cc1f4d48b2fa0991838a8217e77898786';
+    r'5f5009ecf893acd0a8814a57432abeab66b05325';
 
 /// See also [SelectEstateViewModel].
 @ProviderFor(SelectEstateViewModel)

+ 1 - 1
packages/cpt_auth/lib/modules/select_unit/select_unit_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'select_unit_view_model.dart';
 // **************************************************************************
 
 String _$selectUnitViewModelHash() =>
-    r'f31ffde34c823cf1b3ab7477ddcfda312ccce307';
+    r'f4f8001a0fa6e406b06fe7a8ecaba8e6309e21c5';
 
 /// See also [SelectUnitViewModel].
 @ProviderFor(SelectUnitViewModel)

+ 23 - 7
packages/cpt_auth/lib/modules/sign_up/sign_up_view_model.dart

@@ -1,5 +1,7 @@
 import 'package:cpt_auth/modules/sing_up_verify/sign_up_verify_page.dart';
 import 'package:flutter/material.dart';
+import 'package:plugin_basic/dialog/verify_code_dialog.dart';
+import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/log_utils.dart';
@@ -97,17 +99,31 @@ class SignUpViewModel extends _$SignUpViewModel {
       return;
     }
 
-    //执行密码登录
-    ToastEngine.show('准备执行请求发送验证码 firstName:$firstName lastName:$lastName email:$email phone:$phone password:$password confirmPassword:$confirmPassword');
 
-    gotoSignUpVerifyPage();
-  }
+    //短信验证码之前的图片验证码弹窗
+    DialogEngine.show(
+      onDismiss: () {},
+      widget: VerifyCodeDialog(
+        confirmAction: (key, code) {
+          //去新页面发送短信验证码并校验和注册用户
+          SignUpVerifyPage.startInstance(
+            firstName: firstName,
+            lastName: lastName,
+            email: email,
+            phone: phone,
+            password: password,
+            confirmPassword: confirmPassword,
+            verifyKey: key,
+            verifyCode: code,
+          );
+        },
+      ),
+    );
+
 
-  //去注册的短信校验页面
-  void gotoSignUpVerifyPage() {
-    SignUpVerifyPage.startInstance();
   }
 
+
   //切换隐藏显示密码
   void switchPwdVisibility() {
     state = state.copyWith(pwdVisibility: !state.pwdVisibility);

+ 1 - 1
packages/cpt_auth/lib/modules/sign_up/sign_up_view_model.g.dart

@@ -6,7 +6,7 @@ part of 'sign_up_view_model.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$signUpViewModelHash() => r'9953c49f83eace3fa24d85f5bc8cf95212175ff9';
+String _$signUpViewModelHash() => r'47850a34e661455a7b752fc95c1ddb0ba30c3b4c';
 
 /// See also [SignUpViewModel].
 @ProviderFor(SignUpViewModel)

+ 6 - 5
packages/cpt_auth/lib/modules/sing_up_success/sign_up_success_page.dart

@@ -19,11 +19,12 @@ class SignUpSuccessPage extends HookConsumerWidget {
 
   //启动当前页面
   static void startInstance({BuildContext? context}) {
-    if (context != null) {
-      context.router.popAndPush(const SignUpSuccessPageRoute());
-    } else {
-      appRouter.popAndPush(const SignUpSuccessPageRoute());
-    }
+    appRouter.pushAndPopUntil(
+      const SignUpSuccessPageRoute(),
+      predicate: (route) {
+        return route.settings.name == 'AuthLoginPageRoute';
+      },
+    );
   }
 
   @override

+ 1 - 1
packages/cpt_auth/lib/modules/sing_up_success/sign_up_success_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'sign_up_success_view_model.dart';
 // **************************************************************************
 
 String _$signUpSuccessViewModelHash() =>
-    r'715f2ae03093839694f7336d2cf8f0b57ce65d95';
+    r'7c137417584f468299cce7cf59fc08a28f038227';
 
 /// See also [SignUpSuccessViewModel].
 @ProviderFor(SignUpSuccessViewModel)

+ 80 - 13
packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_page.dart

@@ -3,6 +3,7 @@ import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/material.dart';
 import 'package:auto_route/auto_route.dart';
+import 'package:flutter_hooks/flutter_hooks.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:router/ext/auto_router_extensions.dart';
@@ -17,15 +18,48 @@ import 'sign_up_verify_view_model.dart';
 
 @RoutePage()
 class SignUpVerifyPage extends HookConsumerWidget {
-  const SignUpVerifyPage({Key? key}) : super(key: key);
+  final String firstName;
+  final String lastName;
+  final String email;
+  final String phone;
+  final String password;
+  final String confirmPassword;
+  final String? verifyKey;
+  final String? verifyCode;
+
+  const SignUpVerifyPage({
+    Key? key,
+    required this.firstName,
+    required this.lastName,
+    required this.email,
+    required this.phone,
+    required this.password,
+    required this.confirmPassword,
+    required this.verifyKey,
+    required this.verifyCode,
+  }) : super(key: key);
 
   //启动当前页面
-  static void startInstance({BuildContext? context}) {
-    if (context != null) {
-      context.router.popAndPush(const SignUpVerifyPageRoute());
-    } else {
-      appRouter.popAndPush(const SignUpVerifyPageRoute());
-    }
+  static void startInstance({
+    required String firstName,
+    required String lastName,
+    required String email,
+    required String phone,
+    required String password,
+    required String confirmPassword,
+    required String? verifyKey,
+    required String? verifyCode,
+  }) {
+    appRouter.push(SignUpVerifyPageRoute(
+      firstName: firstName,
+      lastName: lastName,
+      email: email,
+      phone: phone,
+      password: password,
+      confirmPassword: confirmPassword,
+      verifyKey: verifyKey,
+      verifyCode: verifyCode,
+    ));
   }
 
   @override
@@ -33,7 +67,17 @@ class SignUpVerifyPage extends HookConsumerWidget {
     final viewModel = ref.watch(signUpVerifyViewModelProvider.notifier);
     final state = ref.watch(signUpVerifyViewModelProvider);
 
-    const length = 4;
+    useEffect(() {
+      Future.microtask(() {
+        //默认进来就发短信
+        viewModel.sendSMS(phone, verifyKey, verifyCode);
+      });
+      return () {
+      };
+    }, []);
+
+    String? smsCode;  //已输入的短信验证码
+    const length = 6;
     final borderColor = context.appColors.textPrimary;
     const errorColor = Colors.redAccent;
     final fillColor = context.appColors.authFiledBG;
@@ -85,7 +129,16 @@ class SignUpVerifyPage extends HookConsumerWidget {
                   focusNode: state.focusNode,
                   defaultPinTheme: defaultPinTheme,
                   onCompleted: (pin) {
-                    ToastEngine.show("输入的验证码为:$pin");
+                    smsCode = pin;
+                    viewModel.verifySignUpInput(
+                      firstName: firstName,
+                      lastName: lastName,
+                      email: email,
+                      phone: phone,
+                      password: password,
+                      confirmPassword: confirmPassword,
+                      smsCode: pin,
+                    );
                   },
                   focusedPinTheme: defaultPinTheme.copyWith(
                     height: 50,
@@ -114,10 +167,14 @@ class SignUpVerifyPage extends HookConsumerWidget {
               ),
 
               MyButton(
-                onPressed: viewModel.verifySignUpInput,
-                text: S.current.resend_code,
+                onPressed: () {
+                  if (!state.isCounting) {
+                    viewModel.showVerifyCodedDialog(phone);
+                  }
+                },
+                text: state.isCounting ? "${state.countdownTime} s" : S.current.resend_code,
                 textColor: Colors.white,
-                backgroundColor: context.appColors.orangeBG,
+                backgroundColor: state.isCounting ? context.appColors.disEnableGray : context.appColors.orangeBG,
                 fontWeight: FontWeight.w500,
                 type: ClickType.throttle,
                 fontSize: 16,
@@ -150,7 +207,17 @@ class SignUpVerifyPage extends HookConsumerWidget {
               ).marginOnly(top: 16),
 
               MyButton(
-                onPressed: viewModel.verifySignUpInput,
+                onPressed: () {
+                  viewModel.verifySignUpInput(
+                    firstName: firstName,
+                    lastName: lastName,
+                    email: email,
+                    phone: phone,
+                    password: password,
+                    confirmPassword: confirmPassword,
+                    smsCode: smsCode,
+                  );
+                },
                 text: S.current.next,
                 textColor: Colors.white,
                 backgroundColor: context.appColors.btnBgDefault,

+ 26 - 4
packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_state.dart

@@ -1,8 +1,30 @@
 import 'package:flutter/material.dart';
 
-class SignUpVerifyState{
+class SignUpVerifyState {
+  final TextEditingController controller;
+  final FocusNode focusNode;
 
-  final controller = TextEditingController();
-  final focusNode = FocusNode();
+  // 获取验证码的倒计时
+  bool isCounting;
+  int countdownTime;
 
-}
+  SignUpVerifyState({
+    this.isCounting = false,
+    this.countdownTime = 0,
+    TextEditingController? controller,
+    FocusNode? focusNode,
+  })  : controller = controller ?? TextEditingController(),
+        focusNode = focusNode ?? FocusNode();
+
+  SignUpVerifyState copyWith({
+    bool? isCounting,
+    int? countdownTime,
+  }) {
+    return SignUpVerifyState(
+      isCounting: isCounting ?? this.isCounting,
+      countdownTime: countdownTime ?? this.countdownTime,
+      controller: this.controller,
+      focusNode: this.focusNode,
+    );
+  }
+}

+ 102 - 4
packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_view_model.dart

@@ -1,6 +1,17 @@
+import 'dart:async';
+
 import 'package:cpt_auth/modules/sing_up_success/sign_up_success_page.dart';
+import 'package:cs_resources/generated/l10n.dart';
+import 'package:domain/repository/auth_repository.dart';
+import 'package:plugin_basic/constants/app_constant.dart';
+import 'package:plugin_basic/dialog/verify_code_dialog.dart';
+import 'package:plugin_basic/provider/user_config/user_config_service.dart';
+import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
+import 'package:plugin_platform/engine/notify/notify_engine.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/util.dart';
 
 import 'sign_up_verify_state.dart';
 
@@ -8,8 +19,12 @@ part 'sign_up_verify_view_model.g.dart';
 
 @riverpod
 class SignUpVerifyViewModel extends _$SignUpVerifyViewModel {
+  late final AuthRepository authRepository;
+
   @override
   SignUpVerifyState build() {
+    authRepository = ref.read(authRepositoryProvider);
+
     final state = SignUpVerifyState();
     ref.onDispose(() {
       onDispose(state);
@@ -17,15 +32,98 @@ class SignUpVerifyViewModel extends _$SignUpVerifyViewModel {
     return state;
   }
 
-  //校验SMS短信验证码
-  void verifySignUpInput() {
-    SignUpSuccessPage.startInstance();
+  //校验SMS短信验证码,并完成用户注册
+  void verifySignUpInput({
+    required String firstName,
+    required String lastName,
+    required String email,
+    required String phone,
+    required String password,
+    required String confirmPassword,
+    required String? smsCode,
+  }) async {
+    if (Utils.isEmpty(smsCode)) {
+      ToastEngine.show('Enter SMS Code');
+      return;
+    }
+
+    final result = await authRepository.userRegister(
+      firstName: firstName,
+      lastName: lastName,
+      email: email,
+      countryCode: AppConstant.countryCode,
+      phone: phone,
+      password: password,
+      confirmPassword: confirmPassword,
+      smsCode: smsCode,
+    );
+
+    if (result.isSuccess) {
+      NotifyEngine.showSuccess(S.current.successful);
+      //存入Token
+      UserConfigService.getInstance().setToken(result.data?.token);
+      //去成功页面
+      SignUpSuccessPage.startInstance();
+    } else {
+      ToastEngine.show(result.errorMsg ?? "UnKnow Error");
+    }
   }
 
   //销毁资源
   void onDispose(SignUpVerifyState initState) {
+    state.controller.dispose();
+    state.focusNode.dispose();
+    countdownTimer?.cancel();
+  }
 
-    Log.d("SignUpVerifyViewModel 销毁 onDispose");
+  //展示验证码的弹窗
+  showVerifyCodedDialog(String phone) {
+    DialogEngine.show(
+      onDismiss: () {},
+      widget: VerifyCodeDialog(
+        confirmAction: (key, code) {
+          //发送短信验证码
+          sendSMS(phone, key, code);
+        },
+      ),
+    );
   }
 
+  /// 调用接口发送短信验证码
+  void sendSMS(String phone, String? key, String? code) async {
+    final result = await authRepository.sendSMS(
+      countryCode: AppConstant.countryCode,
+      phone: phone,
+      captchaKey: key,
+      captchaValue: code,
+    );
+
+    if (result.isSuccess) {
+      NotifyEngine.showSuccess(S.current.send_sms_successful);
+      _startCountDown();
+    } else {
+      ToastEngine.show(result.errorMsg ?? "UnKnow Error");
+    }
+  }
+
+  Timer? countdownTimer;
+
+  /// 开启倒计时
+  void _startCountDown() {
+    //60秒倒计时
+    state = state.copyWith(isCounting: true, countdownTime: 60);
+
+    //每秒的倒计时
+    countdownTimer = Timer.periodic(const Duration(seconds: 1), (timer) {
+      int time = state.countdownTime;
+      Log.d('倒计时-->$time');
+      if (time > 0) {
+        time--;
+        state = state.copyWith(isCounting: true, countdownTime: time);
+      } else {
+        state = state.copyWith(isCounting: false, countdownTime: 0);
+        countdownTimer?.cancel(); // 取消计时器
+      }
+    });
+  }
 }

+ 1 - 1
packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'sign_up_verify_view_model.dart';
 // **************************************************************************
 
 String _$signUpVerifyViewModelHash() =>
-    r'3ed4563220e5e1ae25ff7650c8d005e496e68334';
+    r'853c61774b0353652744df67e42d7fefe16f41e7';
 
 /// See also [SignUpVerifyViewModel].
 @ProviderFor(SignUpVerifyViewModel)

+ 5 - 0
packages/cpt_auth/lib/router/component/auth_component_service.dart

@@ -25,4 +25,9 @@ class AuthComponentService extends AuthService {
   void startSelectEstatePage() {
     SelectEstatePage.startInstance();
   }
+
+  @override
+  void startAndPopAllLoginPage() {
+    AuthLoginPage.startAndPopAll();
+  }
 }

+ 75 - 5
packages/cpt_auth/lib/router/page/auth_page_router.gr.dart

@@ -68,9 +68,20 @@ abstract class _$AuthPageRouter extends RootStackRouter {
       );
     },
     SignUpVerifyPageRoute.name: (routeData) {
+      final args = routeData.argsAs<SignUpVerifyPageRouteArgs>();
       return AutoRoutePage<dynamic>(
         routeData: routeData,
-        child: const SignUpVerifyPage(),
+        child: SignUpVerifyPage(
+          key: args.key,
+          firstName: args.firstName,
+          lastName: args.lastName,
+          email: args.email,
+          phone: args.phone,
+          password: args.password,
+          confirmPassword: args.confirmPassword,
+          verifyKey: args.verifyKey,
+          verifyCode: args.verifyCode,
+        ),
       );
     },
     TenantDocPageRoute.name: (routeData) {
@@ -228,16 +239,75 @@ class SignUpSuccessPageRoute extends PageRouteInfo<void> {
 
 /// generated route for
 /// [SignUpVerifyPage]
-class SignUpVerifyPageRoute extends PageRouteInfo<void> {
-  const SignUpVerifyPageRoute({List<PageRouteInfo>? children})
-      : super(
+class SignUpVerifyPageRoute extends PageRouteInfo<SignUpVerifyPageRouteArgs> {
+  SignUpVerifyPageRoute({
+    Key? key,
+    required String firstName,
+    required String lastName,
+    required String email,
+    required String phone,
+    required String password,
+    required String confirmPassword,
+    required String? verifyKey,
+    required String? verifyCode,
+    List<PageRouteInfo>? children,
+  }) : super(
           SignUpVerifyPageRoute.name,
+          args: SignUpVerifyPageRouteArgs(
+            key: key,
+            firstName: firstName,
+            lastName: lastName,
+            email: email,
+            phone: phone,
+            password: password,
+            confirmPassword: confirmPassword,
+            verifyKey: verifyKey,
+            verifyCode: verifyCode,
+          ),
           initialChildren: children,
         );
 
   static const String name = 'SignUpVerifyPageRoute';
 
-  static const PageInfo<void> page = PageInfo<void>(name);
+  static const PageInfo<SignUpVerifyPageRouteArgs> page =
+      PageInfo<SignUpVerifyPageRouteArgs>(name);
+}
+
+class SignUpVerifyPageRouteArgs {
+  const SignUpVerifyPageRouteArgs({
+    this.key,
+    required this.firstName,
+    required this.lastName,
+    required this.email,
+    required this.phone,
+    required this.password,
+    required this.confirmPassword,
+    required this.verifyKey,
+    required this.verifyCode,
+  });
+
+  final Key? key;
+
+  final String firstName;
+
+  final String lastName;
+
+  final String email;
+
+  final String phone;
+
+  final String password;
+
+  final String confirmPassword;
+
+  final String? verifyKey;
+
+  final String? verifyCode;
+
+  @override
+  String toString() {
+    return 'SignUpVerifyPageRouteArgs{key: $key, firstName: $firstName, lastName: $lastName, email: $email, phone: $phone, password: $password, confirmPassword: $confirmPassword, verifyKey: $verifyKey, verifyCode: $verifyCode}';
+  }
 }
 
 /// generated route for

+ 0 - 280
packages/cpt_main/lib/modules/demo_page.dart

@@ -1,280 +0,0 @@
-import 'package:cs_resources/theme/app_colors_theme.dart';
-import 'package:cs_resources/theme/theme_config.dart';
-import 'package:cs_resources/theme/theme_notifier.dart';
-import 'package:flutter/cupertino.dart';
-import 'package:flutter/material.dart';
-import 'package:auto_route/auto_route.dart';
-import 'package:hooks_riverpod/hooks_riverpod.dart';
-import 'package:plugin_basic/basic_export.dart';
-import 'package:plugin_basic/provider/user_config/user_config_service.dart';
-import 'package:plugin_platform/engine/cache/local_cache_manager.dart';
-import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
-import 'package:plugin_platform/engine/directory/directory_util.dart';
-import 'package:plugin_platform/engine/image/image_preview.dart';
-import 'package:plugin_platform/engine/media/image_picker_utils.dart';
-import 'package:plugin_platform/engine/notify/notify_engine.dart';
-import 'package:plugin_platform/engine/sp/sp_util.dart';
-import 'package:plugin_platform/engine/toast/toast_engine.dart';
-import 'package:shared/utils/log_utils.dart';
-import 'package:widgets/dialog/app_default_dialog.dart';
-import 'package:widgets/ext/ex_widget.dart';
-import 'package:widgets/my_load_image.dart';
-import 'package:widgets/picker/date_picker_util.dart';
-import 'package:widgets/picker/option_pick_util.dart';
-import 'package:plugin_platform/platform_export.dart';
-
-
-class DemoPage extends HookConsumerWidget {
-  const DemoPage({Key? key}) : super(key: key);
-
-  @override
-  Widget build(BuildContext context, WidgetRef ref) {
-    final _userService = UserConfigService.getInstance(ref: ref);
-    final _userConfig = UserConfigService.getState(ref: ref);
-    Log.d("VisitorPage - build 了");
-
-    return Scaffold(
-      appBar: AppBar(title: Text("Visitor"),systemOverlayStyle: ThemeConfig.getSystemUiOverlayStyleByTheme(context)),
-      backgroundColor: context.appColors.backgroundDefault,
-      body: Center(
-        child: Column(
-          children: [
-            Row(
-              mainAxisAlignment: MainAxisAlignment.spaceAround,
-              children: [
-                Text("当前的用户:${_userConfig.userName}"),
-                ElevatedButton(
-                  onPressed: () {
-                    _userService.setUserInfo("张三");
-                  },
-                  child: Text(
-                    '修改用户信息',
-                  ),
-                ),
-              ],
-            ).marginOnly(top: 10),
-            Row(
-              mainAxisAlignment: MainAxisAlignment.spaceAround,
-              children: [
-                ElevatedButton(
-                  onPressed: () {
-                   // fetchServerTime();
-                  },
-                  child: Text('网络请求'),
-                ),
-                ElevatedButton(
-                  onPressed: () {
-                    ToastEngine.show("这是一个吐司气泡");
-                  },
-                  child: Text('吐司/气泡'),
-                ),
-                ElevatedButton(
-                  onPressed: () async {
-                    NotifyEngine.showSuccess("操作成功");
-                    await Future.delayed(Duration(seconds: 3));
-                    NotifyEngine.showFailure("操作失败");
-                    await Future.delayed(Duration(seconds: 3));
-                    NotifyEngine.showError("操作错误");
-                  },
-                  child: Text('成功/失败通知'),
-                ),
-              ],
-            ).marginOnly(top: 10),
-            Row(
-              mainAxisAlignment: MainAxisAlignment.spaceAround,
-              children: [
-                ElevatedButton(
-                  onPressed: () {
-                    DialogEngine.show(
-                        widget: AppDefaultDialog(
-                          //这种布局自己自定义去
-                          title: "提示",
-                          message: "默认的弹窗,自定义的弹窗自己画去",
-                          confirmAction: () {
-                            ToastEngine.show("点击了确定");
-                          },
-                        ));
-                  },
-                  child: Text('弹窗'),
-                ),
-                ElevatedButton(
-                  onPressed: () {
-                    DateTime dateTime = DateTime.now();
-                    DatePickerUtil.showCupertinoDatePicker(
-                      mode: CupertinoDatePickerMode.date,
-                      selectedDateTime: dateTime,
-                      onDateTimeChanged: (date) {
-                        dateTime = date;
-                      },
-                      title: "选择日期",
-                    );
-                  },
-                  child: Text('时间选择'),
-                ),
-                ElevatedButton(
-                  onPressed: () {
-                    OptionPickerUtil.showCupertinoOptionPicker(
-                      items: ["前天", "昨天", "今天", "明天", "后天"],
-                      initialSelectIndex: 0,
-                      onPickerChanged: (_, index) {
-                        ToastEngine.show("选中的索引为:$index");
-                      },
-                    );
-                  },
-                  child: Text('条件选择'),
-                ),
-              ],
-            ).marginOnly(top: 10),
-            Row(
-              mainAxisAlignment: MainAxisAlignment.spaceAround,
-              children: [
-                ElevatedButton(
-                  onPressed: () {
-                    ImagePickerUtils().show(context, (filePath) {
-                      ToastEngine.show("图片的路径为:$filePath");
-                    });
-                  },
-                  child: Text('相册/相册'),
-                ),
-                ElevatedButton(
-                  onPressed: () async {
-                    final PermissionStatus permissionStatus = await Permission.phone.request();
-                    if (permissionStatus.isGranted) {
-                      final Uri launchUri = Uri(
-                        scheme: 'tel',
-                        path: "+8618571458165",
-                      );
-                      await launchUrl(launchUri);
-                    } else {
-                      // 权限被拒绝
-                      ToastEngine.show('Phone call permission denied');
-                    }
-                  },
-                  child: Text('App动态权限'),
-                ),
-              ],
-            ).marginOnly(top: 10),
-            Row(
-              mainAxisAlignment: MainAxisAlignment.spaceAround,
-              children: [
-                ElevatedButton(
-                  onPressed: () async {
-                    final tempPath = DirectoryUtil.getTempPath();
-                    final docPath = DirectoryUtil.getAppDocPath();
-                    final appSupportPath = DirectoryUtil.getAppSupportPath();
-                    final storagePath = DirectoryUtil.getStoragePath(); //只能拿沙盒路径,外置SD卡是拿不到的
-                    final cacheSize = await DirectoryUtil.getAppCacheSize();
-
-                    Log.d("沙盒路径 - tempPath:$tempPath docPath:$docPath appSupportPath:$appSupportPath storagePath:$storagePath "
-                        "cacheSize:$cacheSize");
-                  },
-                  child: Text('沙盒路径'),
-                ),
-                ElevatedButton(
-                  onPressed: () async {
-                    //Key-Value的重要信息持久化缓存(只存小东西如配置,token)
-                    await SPUtil.putBool("isVip", true);
-                    final isVip = SPUtil.getBool("isVip", defValue: false);
-                    Log.d("存入并取出SP的值 - isVip:$isVip");
-
-                    //沙盒缓存文件缓存(可存入对象,大文本,Json,网络请求数据)
-                    await localCache.put("name", "李四", expiry: const Duration(seconds: 10));
-                    await localCache.put("age", 28, expiry: const Duration(seconds: 10));
-                    await localCache.put("gender", 1);
-                    await localCache.put("skills", ["游泳", "跑步", "编程"]);
-                    await localCache.put("json", {"code": "200", "msg": "Success", "data": 2});
-
-                    String? name = await localCache.get("name");
-                    int? age = await localCache.get("age");
-                    int? gender = await localCache.get("gender");
-                    List<String>? skills = await localCache.get("skills");
-                    Map<String, dynamic>? json = await localCache.get("json");
-                    Log.d("获取缓存name:$name");
-                    Log.d("获取缓存age:$age");
-                    Log.d("获取缓存gender:$gender");
-                    Log.d("获取缓存skills:$skills");
-                    Log.d("获取缓存json:$json");
-                  },
-                  child: Text('缓存用法'),
-                ),
-                ElevatedButton(
-                  onPressed: () {},
-                  child: Text('图片预览'),
-                ),
-              ],
-            ).marginOnly(top: 10),
-            Row(
-              mainAxisAlignment: MainAxisAlignment.spaceAround,
-              children: [
-                ElevatedButton(
-                  onPressed: () {},
-                  child: Text('图片加载'),
-                ),
-                Hero(
-                    tag: '112cc8a34e13',
-                    child: MyLoadImage("https://pic.quanjing.com/cz/8s/QJ8856274343.jpg@%21794ws", width: 80, height: 80),
-                ),
-                ElevatedButton(
-                  onPressed: () {
-                    //单图预览,支持hero
-                    ImagePreviewEngine.singleImagePreview(context, "https://pic.quanjing.com/cz/8s/QJ8856274343.jpg@%21794ws", heroTag: '112cc8a34e13');
-                    //多图预览,支持hero
-                    // ImagePreviewEngine.multipleImagePreview(context, "https://pic.quanjing.com/cz/8s/QJ8856274343.jpg@%21794ws");
-                  },
-                  child: Text('图片预览'),
-                ),
-              ],
-            ).marginOnly(top: 10),
-            Row(
-              mainAxisAlignment: MainAxisAlignment.spaceAround,
-              children: [
-                ElevatedButton(
-                  onPressed: () {
-                    ref.read(themeProvider.notifier).toggleTheme();
-                  },
-                  child: Text('手动切换主题'),
-                  style: ButtonStyle(
-                    backgroundColor: WidgetStateProperty.all<Color>(context.appColors.btnBgDefault),
-                    // 设置按钮的背景颜色
-                    foregroundColor: WidgetStateProperty.all<Color>(Colors.white),
-                    // 设置按钮文字的颜色
-                    shadowColor: WidgetStateProperty.all<Color>(context.appColors.btnBgDefault),
-                    // 按钮阴影颜色
-                    elevation: WidgetStateProperty.all<double>(5),
-                    // 按钮阴影的高度
-                    shape: WidgetStateProperty.all<RoundedRectangleBorder>(
-                      RoundedRectangleBorder(
-                        borderRadius: BorderRadius.circular(30), // 圆角边框
-                      ),
-                    ),
-                  ),
-                ),
-                ElevatedButton(
-                  onPressed: () {
-                    ref.read(themeProvider.notifier).followSystemTheme();
-                  },
-                  child: Text('跟随系统主题'),
-                  style: ButtonStyle(
-                    backgroundColor: WidgetStateProperty.all<Color>(context.appColors.btnBgDefault),
-                    // 设置按钮的背景颜色
-                    foregroundColor: WidgetStateProperty.all<Color>(Colors.white),
-                    // 设置按钮文字的颜色
-                    shadowColor: WidgetStateProperty.all<Color>(context.appColors.btnBgDefault),
-                    // 按钮阴影颜色
-                    elevation: WidgetStateProperty.all<double>(5),
-                    // 按钮阴影的高度
-                    shape: WidgetStateProperty.all<RoundedRectangleBorder>(
-                      RoundedRectangleBorder(
-                        borderRadius: BorderRadius.circular(30), // 圆角边框
-                      ),
-                    ),
-                  ),
-                ),
-              ],
-            ).marginOnly(top: 10),
-          ],
-        ),
-      ),
-    );
-  }
-}

+ 1 - 1
packages/cpt_main/lib/modules/feedback/create/feedback_create_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'feedback_create_view_model.dart';
 // **************************************************************************
 
 String _$feedbackCreateViewModelHash() =>
-    r'fc34ceec68ee5e8a6175a9a3672a4ff2f60d4c61';
+    r'ee07ee653b4c52ef48983fa988a0043ea3b4f057';
 
 /// See also [FeedbackCreateViewModel].
 @ProviderFor(FeedbackCreateViewModel)

+ 0 - 1
packages/cpt_main/lib/modules/feedback/create_success/feedback_create_success_page.dart

@@ -1,4 +1,3 @@
-import 'package:cpt_main/modules/demo_page.dart';
 import 'package:cpt_main/modules/main/main_page.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/generated/l10n.dart';

+ 0 - 1
packages/cpt_main/lib/modules/feedback/detail/feedback_detail_page.dart

@@ -1,4 +1,3 @@
-import 'package:cpt_main/modules/demo_page.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';

+ 0 - 1
packages/cpt_main/lib/modules/feedback/item_feedback.dart

@@ -1,4 +1,3 @@
-import 'package:cpt_main/modules/demo_page.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/material.dart';

+ 1 - 8
packages/cpt_main/lib/modules/home/home_page.dart

@@ -32,15 +32,8 @@ class HomePage extends HookConsumerWidget {
 
     return Scaffold(
       appBar: MyAppBar.appBar(context, "Good Afternoon,Mike",
-          backIconPath: Assets.mainTabMeSelected,
-          backIconWidth: 18.5,
-          backIconHeight: 20,
-          showBackButton: true,
+          showBackButton: false,
           backgroundColor: context.appColors.backgroundWhite,
-          backCallback: (){
-          ToastEngine.show("测试去登录页面");
-          ComponentServiceManager().authService.startLoginPage();
-          },
           actions: [
             Center(
                     child: Stack(

+ 10 - 47
packages/cpt_main/lib/modules/main/main_page.dart

@@ -1,9 +1,13 @@
 import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/src/widgets/framework.dart';
+import 'package:flutter_hooks/flutter_hooks.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:flutter/material.dart';
+import 'package:plugin_basic/constants/app_constant.dart';
 import 'package:shared/utils/device_utils.dart';
+import 'package:shared/utils/event_bus.dart';
+import 'package:shared/utils/log_utils.dart';
 import '../../router/page/main_page_router.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 
@@ -29,53 +33,12 @@ class MainPage extends HookConsumerWidget {
     final viewModel = ref.watch(mainViewModelProvider.notifier);
     final state = ref.watch(mainViewModelProvider);
 
-    // return AutoTabsRouter(
-    //   routes: const [
-    //     HomePageRoute(),
-    //     VisitorPageRoute(),
-    //     FeedbackPageRoute(),
-    //     MePageRoute(),
-    //   ],
-    //   transitionBuilder: (context, child, animation) => FadeTransition(
-    //     opacity: animation,
-    //     child: child,
-    //   ),
-    //   builder: (context, child) {
-    //     final tabsRouter = AutoTabsRouter.of(context);
-    //     return AnnotatedRegion<SystemUiOverlayStyle>(
-    //         value: ThemeConfig.getSystemUiOverlayStyleByTheme(context),
-    //         child: Scaffold(
-    //           body: child,
-    //           bottomNavigationBar: BottomNavigationBar(
-    //             backgroundColor: context.theme.primaryColor,
-    //             selectedItemColor: context.theme.colorScheme.secondary,
-    //             unselectedItemColor: Colors.grey[500],
-    //             elevation: 20,
-    //             type: BottomNavigationBarType.fixed,
-    //             items: const <BottomNavigationBarItem>[
-    //               BottomNavigationBarItem(
-    //                 icon: Icon(Icons.home),
-    //                 label: 'Home',
-    //               ),
-    //               BottomNavigationBarItem(
-    //                 icon: Icon(Icons.card_giftcard),
-    //                 label: 'Visitor',
-    //               ),
-    //               BottomNavigationBarItem(
-    //                 icon: Icon(Icons.feed),
-    //                 label: 'Feedback',
-    //               ),
-    //               BottomNavigationBarItem(
-    //                 icon: Icon(Icons.person),
-    //                 label: 'Me',
-    //               ),
-    //             ],
-    //             onTap: tabsRouter.setActiveIndex,
-    //             currentIndex: tabsRouter.activeIndex,
-    //           ),
-    //         ));
-    //   },
-    // );
+    useEffect(() {
+
+      Future.microtask(() => viewModel.fetchUserInfo());
+      return () {
+      };
+    }, []);
 
     return AutoTabsScaffold(
       routes: const [

+ 15 - 6
packages/cpt_main/lib/modules/main/main_view_model.dart

@@ -1,15 +1,24 @@
-
+import 'package:plugin_basic/provider/user_config/user_config_service.dart';
+import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
-
 import 'main_state.dart';
+
 part 'main_view_model.g.dart';
 
 @riverpod
-class MainViewModel extends _$MainViewModel {
-
+class MainViewModel extends _$MainViewModel with DioCancelableMixin {
   @override
-  MainState build(){
-    return MainState();
+  MainState build() {
+    final state = MainState();
+
+    registerCancellation();
+
+    return state;
+  }
+
+  /// 获取用户信息
+  void fetchUserInfo() {
+    UserConfigService.getInstance().refreshUserInfo();
   }
 
 }

+ 1 - 1
packages/cpt_main/lib/modules/main/main_view_model.g.dart

@@ -6,7 +6,7 @@ part of 'main_view_model.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$mainViewModelHash() => r'90a50899c1c9b358ab052eae6102c1666d59de8e';
+String _$mainViewModelHash() => r'755642bf17f8e933622907db69f84db9cb02f40e';
 
 /// See also [MainViewModel].
 @ProviderFor(MainViewModel)

+ 15 - 10
packages/cpt_main/lib/modules/me/me_page.dart

@@ -1,4 +1,3 @@
-import 'package:cpt_main/modules/demo_page.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
@@ -6,6 +5,7 @@ import 'package:cs_resources/theme/theme_config.dart';
 import 'package:flutter/material.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:plugin_basic/provider/user_config/user_config_service.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_appbar.dart';
 import 'package:widgets/my_load_image.dart';
@@ -21,6 +21,7 @@ class MePage extends HookConsumerWidget {
   @override
   Widget build(BuildContext context, WidgetRef ref) {
     final viewModel = ref.watch(meViewModelProvider.notifier);
+    final userConfig = UserConfigService.getState(ref: ref);
 
     return Scaffold(
       appBar: MyAppBar.appBar(
@@ -54,7 +55,7 @@ class MePage extends HookConsumerWidget {
                 iconPath: Assets.mainMeMyPostIcon,
                 isShowMoreIcon: true,
                 rightWidget: MyTextView(
-                  "265",
+                  userConfig.user?.postsCount ?? "0",
                   textColor: context.appColors.textPrimary,
                   fontSize: 20,
                   isFontMedium: true,
@@ -67,7 +68,7 @@ class MePage extends HookConsumerWidget {
                 iconPath: Assets.mainMeHouseholdIcon,
                 isShowMoreIcon: true,
                 rightWidget: MyTextView(
-                  "2",
+                  userConfig.user?.households?.length.toString() ?? "0",
                   textColor: context.appColors.textPrimary,
                   fontSize: 20,
                   isFontMedium: true,
@@ -80,7 +81,7 @@ class MePage extends HookConsumerWidget {
                 iconPath: Assets.mainMeEstateIcon,
                 isShowMoreIcon: true,
                 rightWidget: MyTextView(
-                  "2",
+                  userConfig.user?.estates?.length.toString() ?? "0",
                   textColor: context.appColors.textPrimary,
                   fontSize: 20,
                   isFontMedium: true,
@@ -103,6 +104,8 @@ class MePage extends HookConsumerWidget {
   //编辑顶部的关注与粉丝数量
   Widget _buildFollower(BuildContext context, WidgetRef ref) {
     final viewModel = ref.watch(meViewModelProvider.notifier);
+    final userConfig = UserConfigService.getState(ref: ref);
+
     return Container(
       color: context.appColors.whiteSecondBG,
       width: double.infinity,
@@ -122,7 +125,7 @@ class MePage extends HookConsumerWidget {
                 textColor: context.appColors.textBlack,
               ),
               MyTextView(
-                "(26)",
+                "(${userConfig.user?.followsCount ?? "0"})",
                 isFontBold: true,
                 fontSize: 16,
                 textColor: context.appColors.textPrimary,
@@ -148,7 +151,7 @@ class MePage extends HookConsumerWidget {
                 textColor: context.appColors.textBlack,
               ),
               MyTextView(
-                "(12)",
+                "(${userConfig.user?.flowersCount ?? "0"})",
                 isFontBold: true,
                 fontSize: 16,
                 textColor: context.appColors.textPrimary,
@@ -163,6 +166,8 @@ class MePage extends HookConsumerWidget {
   // 编辑顶部的个人信息
   Widget _buildTopProfile(BuildContext context, WidgetRef ref) {
     final viewModel = ref.watch(meViewModelProvider.notifier);
+    final userConfig = UserConfigService.getState(ref: ref);
+
     return Container(
       color: context.appColors.btnBgDefault,
       width: double.infinity,
@@ -173,7 +178,7 @@ class MePage extends HookConsumerWidget {
         crossAxisAlignment: CrossAxisAlignment.start,
         children: [
           MyLoadImage(
-            "https://img1.baidu.com/it/u=1656098746,3560654086&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=800",
+            userConfig.user?.avatar,
             width: 80,
             height: 80,
             isCircle: true,
@@ -186,7 +191,7 @@ class MePage extends HookConsumerWidget {
               Row(
                 children: [
                   MyTextView(
-                    "Wu Bing Bing",
+                    userConfig.user?.name ?? "-",
                     textColor: Colors.white,
                     fontSize: 18,
                     isFontMedium: true,
@@ -201,7 +206,7 @@ class MePage extends HookConsumerWidget {
 
               //电话
               MyTextView(
-                "+86 12345678901",
+                "+${userConfig.user?.phone ?? "-"}",
                 textColor: Colors.white,
                 fontSize: 15,
                 isFontRegular: true,
@@ -209,7 +214,7 @@ class MePage extends HookConsumerWidget {
 
               //住宅
               MyTextView(
-                "Owner135 #08-29",
+                userConfig.user?.defaultUnit?.address ?? "-",
                 marginTop: 12,
                 textColor: Colors.white,
                 fontSize: 15,

+ 1 - 1
packages/cpt_main/lib/modules/me/me_view_model.dart

@@ -1,7 +1,7 @@
-import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:router/componentRouter/component_service_manager.dart';
 
+
 part 'me_view_model.g.dart';
 
 @riverpod

+ 1 - 1
packages/cpt_main/lib/modules/me/me_view_model.g.dart

@@ -6,7 +6,7 @@ part of 'me_view_model.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$meViewModelHash() => r'2877de7ca5a56800fa659c495a0bf3ff59bd247a';
+String _$meViewModelHash() => r'e7ffdeb5e84ad07ec6167a6249276bc25ca834fb';
 
 /// See also [MeViewModel].
 @ProviderFor(MeViewModel)

+ 0 - 2
packages/cpt_main/lib/modules/notification/item_notification.dart

@@ -1,5 +1,3 @@
-import 'package:cpt_main/modules/demo_page.dart';
-import 'package:cpt_main/modules/notification/notification_group_data.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/material.dart';

+ 0 - 1
packages/cpt_main/lib/modules/visitor/item_visitor.dart

@@ -1,4 +1,3 @@
-import 'package:cpt_main/modules/demo_page.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/material.dart';
 import 'package:widgets/ext/ex_widget.dart';

+ 1 - 0
packages/cpt_profile/lib/modules/change_mobile/change_mobile_view_model.dart

@@ -2,6 +2,7 @@ import 'dart:async';
 
 import 'package:cpt_profile/modules/setting/setting_page.dart';
 import 'package:flutter/material.dart';
+import 'package:plugin_basic/dialog/verify_code_dialog.dart';
 import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';

+ 13 - 5
packages/cpt_profile/lib/modules/setting/setting_view_model.dart

@@ -2,10 +2,11 @@ import 'package:cpt_profile/modules/change_mobile/change_mobile_page.dart';
 import 'package:cpt_profile/modules/reset_password/reset_password_page.dart';
 import 'package:cpt_profile/modules/setting/dialog/account_deactivation_dialog.dart';
 import 'package:cpt_profile/modules/setting/setting_state.dart';
-import 'package:cs_resources/generated/l10n.dart';
+import 'package:plugin_basic/provider/user_config/user_config_service.dart';
 import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:router/componentRouter/component_service_manager.dart';
 import 'package:widgets/dialog/app_default_dialog.dart';
 
 part 'setting_view_model.g.dart';
@@ -36,18 +37,25 @@ class SettingViewModel extends _$SettingViewModel {
         widget: AppDefaultDialog(
       message: "Are you sure you want to logout?",
       confirmAction: () {
-        ToastEngine.show("点击了确定");
+        //清除用户登录信息
+        UserConfigService.getInstance().handleLogoutParams();
+        //清除全部页面栈去登录页面
+        ComponentServiceManager().authService.startAndPopAllLoginPage();
       },
     ));
   }
 
-  //展示删除账号的提示弹窗
+  //删除账号的提示弹窗
   void doDeleteAccount() {
     DialogEngine.show(widget: AccountDeactivationDialog(
       confirmAction: () {
-        ToastEngine.show("点击了确定");
+        //请求接口删除账号
+
+        //清除用户登录信息
+        UserConfigService.getInstance().handleLogoutParams();
+        //清除全部页面栈去登录页面
+        ComponentServiceManager().authService.startAndPopAllLoginPage();
       },
     ));
   }
-
 }

+ 17 - 277
packages/cs_domain/lib/constants/api_constants.dart

@@ -5,303 +5,43 @@ class ApiConstants {
   static const isServerRelease = false;
 
   //域名
-  static const baseUrl = isServerRelease ? 'https://www.casualabour.com' : 'http://yyjobs-api-dev.guadoutech.com';
+  static const baseUrl = isServerRelease ? 'http://dev-yyhome.guadoutech.com' : 'http://dev-yyhome.guadoutech.com';
 
   // =========================== 用户相关 ↓=========================================
 
-  // 酒店登录
-  static const apiUserLogin = "/index.php/api/v1/hotel/login";
+  // 登录
+  static const apiUserLogin = "/api/v1/user/auth/login";
 
-  // 用户登出系统
+  // 登出系统
   static const apiUserLogout = "/index.php/api/v1/hotel/logout";
 
   // 用户修改密码
   static const apiResetPassword = "/index.php/api/v1/hotel/reset";
 
-  //获取用户的详情信息
-  static const apiHotelInfo = "/index.php/api/v1/hotel/info";
+  // 用户忘记密码
+  static const apiForgotPassword = "/index.php/api/v1/hotel/reset";
 
   //用户注册
-  static const apiHotelRegister = "/index.php/api/v1/hotel/register";
+  static const apiAuthRegister = "/api/v1/user/auth/register";
 
   //用户注销
-  static const apiHotelDeactivate = "/index.php/api/v1/hotel/deactivate";
+  static const apiAuthDeactivate = "/index.php/api/v1/hotel/deactivate";
 
-  // =========================== 用工请求 ↓=========================================
+  //验证码图片
+  static const apiCaptchaImage = "/api/v1/user/captcha/index";
 
-  //筛选条件
-  static const apiLabourRequestIndex = "/index.php/api/v1/hotel/lab-req/index";
+  //发送短信
+  static const apiSendSMS = "/api/v1/user/sms/send";
 
-  //用工列表
-  static const apiLabourRequestList = "/index.php/api/v1/hotel/lab-req/table";
+  // =========================== 首页 ↓=========================================
 
-  //添加的选择条件
-  static const apiLabourRequestAddOption = "/index.php/api/v1/hotel/lab-req/add-view";
+  // =========================== Profile ↓=========================================
 
-  //添加用工请求
-  static const apiLabourRequestAddSubmit = "/index.php/api/v1/hotel/lab-req/add-submit";
+  //用户Me页面详情
+  static const apiProfileInfo = "/api/v1/user/me/index";
 
-  //编辑的选项
-  static const apiLabourRequestEditDetail = "/index.php/api/v1/hotel/lab-req/edit-view";
-
-  //编辑的发布
-  static const apiLabourRequestEditSubmit = "/index.php/api/v1/hotel/lab-req/edit-submit";
-
-  //用工请求的审核状态工作流
-  static const apiLabourRequestStateWorkFlow = "/index.php/api/v1/hotel/lab-req/status-view";
-
-  //撤回用工请求
-  static const apiLabourRequestRecall = "/index.php/api/v1/hotel/lab-req/recall";
-
-  // =========================== 工作列表 ↓=========================================
-
-  // 工作列表首页选项
-  static const apiJobListIndex = "/index.php/api/v1/hotel/job/index";
-
-  // 工作列表首页列表
-  static const apiJobListTable = "/index.php/api/v1/hotel/job/table";
-
-  // 工作列表首页详情
-  static const apiJobListDetail = "/index.php/api/v1/hotel/job/detail";
-
-  // 工作已申请员工列表-工作的信息
-  static const apiJobListAppliedJobInfo = "/index.php/api/v1/hotel/applied/index";
-
-  // 工作已申请员工列表-员工列表
-  static const apiJobListAppliedStaffList = "/index.php/api/v1/hotel/applied/table";
-
-  // 工作已申请员工列表-添加员工查询全部员工
-  static const apiJobListAppliedStaffSearch = "/index.php/api/v1/hotel/applied/staff-view";
-
-  // 工作已申请员工列表-添加员工提交
-  static const apiJobListAppliedStaffAdd = "/index.php/api/v1/hotel/applied/staff-submit";
-
-  // 工作已申请员工列表-批量修改员工状态
-  static const apiJobListAppliedStaffBatchEdit = "/index.php/api/v1/hotel/applied/batch-edit";
-
-  // 工作已申请员工列表-编辑员工信息的详情数据
-  static const apiJobListAppliedStaffEditIndex = "/index.php/api/v1/hotel/applied/edit-view";
-
-  // 工作已申请员工列表-编辑员工信息提交
-  static const apiJobListAppliedStaffEditSubmit = "/index.php/api/v1/hotel/applied/edit-submit";
-
-  // 工作已申请员工列表-评价员工的详情数据
-  static const apiJobListAppliedStaffReviewIndex = "/index.php/api/v1/hotel/applied/remark-view";
-
-  // 工作已申请员工列表-评价员工的提交
-  static const apiJobListAppliedStaffReviewSubmit = "/index.php/api/v1/hotel/applied/remark-submit";
-
-  // 工作已申请员工列表-评价员工的提交
-  static const apiJobListAppliedStaffStateWorkflow = "/index.php/api/v1/hotel/applied/status-view";
-
-  // 工作已申请员工列表- 提交指定员工们到审核流程
-  static const apiJobListAppliedApprove = "/index.php/api/v1/hotel/applied/approve";
-
-  //员工详情
-  static const apiJobListStaffDetail = "/index.php/api/v1/hotel/member/detail";
-
-  //员工做工历史记录
-  static const apiJobListStaffLabourHistory = "/index.php/api/v1/hotel/member/history";
-
-  //员工做工评价记录
-  static const apiJobListStaffRemarkHistory = "/index.php/api/v1/hotel/member/remarks";
-
-  // =========================== 签到签出 ↓=========================================
-
-  // 用户签到签出列表
-  static const apiSignApplied = "/index.php/api/v1/hotel/sign/table";
-
-  // 用户签到签出
-  static const apiSignInOut = "/index.php/api/v1/hotel/sign/clock";
-
-  // =========================== 新加坡用工 ↓=========================================
-
-  // 工作标题列表
-  static const apiJobTitleListSG = "/index.php/api/v1/hotel/title/table";
-
-  // 添加工作标题的选项数据
-  static const apiJobTitleAddIndexSG = "/index.php/api/v1/hotel/title/add-view";
-
-  // 添加工作标题提交
-  static const apiJobTitleAddSubmitSG = "/index.php/api/v1/hotel/title/add-submit";
-
-  // 编辑工作标题的选项数据
-  static const apiJobTitleEditIndexSG = "/index.php/api/v1/hotel/title/edit-view";
-
-  // 编辑工作标题提交
-  static const apiJobTitleEditSubmitSG = "/index.php/api/v1/hotel/title/edit-submit";
-
-  // 删除工作标题
-  static const apiJobTitleDeleteSG = "/index.php/api/v1/hotel/title/delete";
-
-  // 工作模板列表
-  static const apiJobTemplateListSG = "/index.php/api/v1/hotel/temp/table";
-
-  // 添加工作模板选项数据
-  static const apiJobTemplateAddIndexSG = "/index.php/api/v1/hotel/temp/add-view";
-
-  // 添加工作模板选提交
-  static const apiJobTemplateAddSubmitSG = "/index.php/api/v1/hotel/temp/add-submit";
-
-  // 编辑工作模板选项数据
-  static const apiJobTemplateEditIndexSG = "/index.php/api/v1/hotel/temp/edit-view";
-
-  // 编辑工作模板提交
-  static const apiJobTemplateEditSubmitSG = "/index.php/api/v1/hotel/temp/edit-submit";
-
-  // 删除工作模板
-  static const apiJobTemplateDeleteSG = "/index.php/api/v1/hotel/temp/delete";
-
-  //用工请求首页数据
-  static const apiLabourRequestMainSG = "/index.php/api/v1/hotel/lab-req/index";
-
-  //用工请求的添加页面选项数据
-  static const apiLabourRequestAddIndexSG = "/index.php/api/v1/hotel/lab-req/add-view";
-
-  //用工请求的添加提交
-  static const apiLabourRequestAddSubmitSG = "/index.php/api/v1/hotel/lab-req/add-submit";
-
-  //用工请求的查询选项(Job List)
-  static const apiJobListIndexSG = "/index.php/api/v1/hotel/job/index";
-
-  //用工请求的查询列表(Job List)
-  static const apiJobListTableSG = "/index.php/api/v1/hotel/job/table";
-
-  //用工请求的编辑详情(Job List)
-  static const apiJobListEditIndexSG = "/index.php/api/v1/hotel/job/edit-view";
-
-  //用工请求的编辑提交(Job List)
-  static const apiJobListEditSubmitSG = "/index.php/api/v1/hotel/job/edit-submit";
-
-  //用工请求的取消(Job List)
-  static const apiJobListCancelSG = "/index.php/api/v1/hotel/job/cancel";
-
-  //用工请求的删除(Job List)
-  static const apiJobListDeleteSG = "/index.php/api/v1/hotel/job/delete";
-
-  //用工请求的考勤确认(Job List)
-  static const apiJobListConfirmSG = "/index.php/api/v1/hotel/job/confirm";
-
-  // =========================== 新加坡工作相关 ↓=========================================
-
-  //新加坡工作已申请的选项
-  static const apiJobAppliedIndexSG = "/index.php/api/v1/hotel/applied/index";
-
-  //新加坡工作已申请的列表
-  static const apiJobAppliedListSG = "/index.php/api/v1/hotel/applied/table";
-
-  //新加坡工作已申请的列表-添加员工搜索
-  static const apiJobAppliedSearchStaffSG = "/index.php/api/v1/hotel/applied/staff-view";
-
-  //新加坡工作已申请的列表-添加员工提交
-  static const apiJobAppliedAddStaffSubmitSG = "/index.php/api/v1/hotel/applied/staff-submit";
-
-  //新加坡工作已申请的列表-批量修改
-  static const apiJobAppliedBatchEditSG = "/index.php/api/v1/hotel/applied/batch-edit";
-
-  //新加坡工作已申请的列表-单独编辑的详情
-  static const apiJobAppliedEditViewSG = "/index.php/api/v1/hotel/applied/edit-view";
-
-  //新加坡工作已申请的列表-提交编辑
-  static const apiJobAppliedEditSubmitSG = "/index.php/api/v1/hotel/applied/edit-submit";
-
-  //新加坡工作已申请的列表-修改状态
-  static const apiJobAppliedChangeStatusSG = "/index.php/api/v1/hotel/applied/edit-status";
-
-  //新加坡工作已申请的列表-评价展示
-  static const apiJobAppliedRemarkViewSG = "/index.php/api/v1/hotel/applied/remark-view";
-
-  //新加坡工作已申请的列表-提交评价
-  static const apiJobAppliedRemarkSubmitSG = "/index.php/api/v1/hotel/applied/remark-submit";
-
-  //员工详情
-  static const apiJobListStaffDetailSG = "/index.php/api/v1/hotel/member/detail";
-
-  //员工做工历史记录
-  static const apiJobListStaffLabourHistorySG = "/index.php/api/v1/hotel/member/history";
-
-  //员工做工评价顶部数据
-  static const apiJobListStaffReviewHeadSG = "/index.php/api/v1/hotel/member/review";
-
-  //员工做工评价列表
-  static const apiJobListStaffReViewHistorySG = "/index.php/api/v1/hotel/member/review/table";
-
-  //员工修改记录-选项
-  static const apiReviseIndexSG = "/index.php/api/v1/hotel/revise/index";
-
-  //员工修改记录-列表
-  static const apiReviseListSG = "/index.php/api/v1/hotel/revise/table";
-
-  //给指定的申请记录添加 Revise 数据(详情)
-  static const apiAddReviseViewSG = "/index.php/api/v1/hotel/revise/add-view";
-
-  //给指定的申请记录添加 Revise 数据(提交)
-  static const apiAddReviseSubmitSG = "/index.php/api/v1/hotel/revise/add-submit";
-
-  //给指定的申请记录编辑 Revise 数据(详情)
-  static const apiEditReviseViewSG = "/index.php/api/v1/hotel/revise/edit-view";
-
-  //给指定的申请记录编辑 Revise 数据(提交)
-  static const apiEditReviseSubmitSG = "/index.php/api/v1/hotel/revise/edit-submit";
-
-  //撤回指定的 Revise 数据
-  static const apiRecallReviseSG = "/index.php/api/v1/hotel/revise/recall";
-
-  //删除指定的 Revise 数据
-  static const apiDeleteReviseSG = "/index.php/api/v1/hotel/revise/delete";
-
-  //Revise 的操作日志
-  static const apiReviseLogListSG = "/index.php/api/v1/hotel/revise/logs";
-
-  // =========================== 报表与其他 ↓=========================================
-
-  // 设备列表
-  static const apiDeviceList = "/index.php/api/v1/hotel/device/table";
-
-  //财务报表
-  static const apiReportFiance = "/index.php/api/v1/hotel/report/finance";
-
-  //用工报表
-  static const apiReportLabour = "/index.php/api/v1/hotel/report/casual";
-
-  //员工申请报表
-  static const apiReportStaffRequest = "/index.php/api/v1/hotel/report/staff";
-
-// =========================== 越南的审核 ↓=========================================
-
-  // 用工审核选项
-  static const apiLabourReviewIndex = "/index.php/api/v1/hotel/lab-review/index";
-
-  // 用工审核列表
-  static const apiLabourReviewTable = "/index.php/api/v1/hotel/lab-review/table";
-
-  // 用工审核的编辑详情
-  static const apiLabourReviewDetail = "/index.php/api/v1/hotel/lab-review/edit-view";
-
-  // 用工审核的编辑提交
-  static const apiLabourReviewEdit = "/index.php/api/v1/hotel/lab-review/edit-submit";
-
-  // 用工审核的审核流程列表
-  static const apiLabourReviewStatusView = "/index.php/api/v1/hotel/lab-review/status-view";
-
-  // 用工审核的批量同意
-  static const apiLabourReviewApprove = "/index.php/api/v1/hotel/lab-review/approve";
-
-  // 用工审核的批量拒绝
-  static const apiLabourReviewReject = "/index.php/api/v1/hotel/lab-review/reject";
-
-  // 考勤的审核列表
-  static const apiAttendanceReviewTable = "/index.php/api/v1/hotel/att-review/table";
-
-  // 考勤的批量同意
-  static const apiAttendanceReviewApprove = "/index.php/api/v1/hotel/att-review/approve";
-
-  // 考勤的批量拒绝
-  static const apiAttendanceReviewReject = "/index.php/api/v1/hotel/att-review/reject";
-
-// =========================== 其他 ↓=========================================
+  // =========================== 其他 ↓=========================================
 
   //服务器时间
   static const apiServerTime = "/index.php/api/employee/extra/time";
-
 }

+ 22 - 0
packages/cs_domain/lib/entity/auth_login_entity.dart

@@ -0,0 +1,22 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/auth_login_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/auth_login_entity.g.dart';
+
+@JsonSerializable()
+class AuthLoginEntity {
+	String? name;
+	String? email;
+	String? token;
+
+	AuthLoginEntity();
+
+	factory AuthLoginEntity.fromJson(Map<String, dynamic> json) => $AuthLoginEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $AuthLoginEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 22 - 0
packages/cs_domain/lib/entity/captcha_img_entity.dart

@@ -0,0 +1,22 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/captcha_img_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/captcha_img_entity.g.dart';
+
+@JsonSerializable()
+class CaptchaImgEntity {
+	bool sensitive = false;
+	String? key;
+	String? img;
+
+	CaptchaImgEntity();
+
+	factory CaptchaImgEntity.fromJson(Map<String, dynamic> json) => $CaptchaImgEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $CaptchaImgEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 135 - 0
packages/cs_domain/lib/entity/user_me_entity.dart

@@ -0,0 +1,135 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/user_me_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/user_me_entity.g.dart';
+
+@JsonSerializable()
+class UserMeEntity {
+	String? id;
+	String? name;
+	String? avatar;
+	String? phone;
+	@JSONField(name: "follows_count")
+	String? followsCount;
+	@JSONField(name: "flowers_count")
+	String? flowersCount;
+	@JSONField(name: "posts_count")
+	String? postsCount;
+	List<UserMeHouseholds>? households = [];
+	List<UserMeEstates>? estates = [];
+	@JSONField(name: "default_unit")
+	UserMeDefaultUnit? defaultUnit;
+
+	UserMeEntity();
+
+	factory UserMeEntity.fromJson(Map<String, dynamic> json) => $UserMeEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $UserMeEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class UserMeHouseholds {
+	String? id;
+	String? name;
+	String? avatar;
+
+	UserMeHouseholds();
+
+	factory UserMeHouseholds.fromJson(Map<String, dynamic> json) => $UserMeHouseholdsFromJson(json);
+
+	Map<String, dynamic> toJson() => $UserMeHouseholdsToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class UserMeEstates {
+	String? id;
+	String? name;
+	List<UserMeEstatesAccounts>? accounts = [];
+
+	UserMeEstates();
+
+	factory UserMeEstates.fromJson(Map<String, dynamic> json) => $UserMeEstatesFromJson(json);
+
+	Map<String, dynamic> toJson() => $UserMeEstatesToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class UserMeEstatesAccounts {
+	String? id;
+	String? name;
+	String? avatar;
+	String? type;
+	@JSONField(name: "default")
+	int isDefault = 0;
+	dynamic status;
+	UserMeEstatesAccountsUnit? unit;
+
+	UserMeEstatesAccounts();
+
+	factory UserMeEstatesAccounts.fromJson(Map<String, dynamic> json) => $UserMeEstatesAccountsFromJson(json);
+
+	Map<String, dynamic> toJson() => $UserMeEstatesAccountsToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class UserMeEstatesAccountsUnit {
+	String? id;
+	String? block;
+	String? street;
+	String? unit;
+	String? address;
+
+	UserMeEstatesAccountsUnit();
+
+	factory UserMeEstatesAccountsUnit.fromJson(Map<String, dynamic> json) => $UserMeEstatesAccountsUnitFromJson(json);
+
+	Map<String, dynamic> toJson() => $UserMeEstatesAccountsUnitToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class UserMeDefaultUnit {
+	String? id;
+	@JSONField(name: "estate_id")
+	String? estateId;
+	String? block;
+	String? street;
+	String? unit;
+	String? address;
+	int type = 0;
+
+	UserMeDefaultUnit();
+
+	factory UserMeDefaultUnit.fromJson(Map<String, dynamic> json) => $UserMeDefaultUnitFromJson(json);
+
+	Map<String, dynamic> toJson() => $UserMeDefaultUnitToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 40 - 0
packages/cs_domain/lib/generated/json/auth_login_entity.g.dart

@@ -0,0 +1,40 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/auth_login_entity.dart';
+
+AuthLoginEntity $AuthLoginEntityFromJson(Map<String, dynamic> json) {
+  final AuthLoginEntity authLoginEntity = AuthLoginEntity();
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    authLoginEntity.name = name;
+  }
+  final String? email = jsonConvert.convert<String>(json['email']);
+  if (email != null) {
+    authLoginEntity.email = email;
+  }
+  final String? token = jsonConvert.convert<String>(json['token']);
+  if (token != null) {
+    authLoginEntity.token = token;
+  }
+  return authLoginEntity;
+}
+
+Map<String, dynamic> $AuthLoginEntityToJson(AuthLoginEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['name'] = entity.name;
+  data['email'] = entity.email;
+  data['token'] = entity.token;
+  return data;
+}
+
+extension AuthLoginEntityExtension on AuthLoginEntity {
+  AuthLoginEntity copyWith({
+    String? name,
+    String? email,
+    String? token,
+  }) {
+    return AuthLoginEntity()
+      ..name = name ?? this.name
+      ..email = email ?? this.email
+      ..token = token ?? this.token;
+  }
+}

+ 42 - 14
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -4,7 +4,10 @@
 
 // This file is automatically generated. DO NOT EDIT, all your changes would be lost.
 import 'package:flutter/material.dart' show debugPrint;
+import 'package:domain/entity/auth_login_entity.dart';
+import 'package:domain/entity/captcha_img_entity.dart';
 import 'package:domain/entity/server_time.dart';
+import 'package:domain/entity/user_me_entity.dart';
 
 JsonConvert jsonConvert = JsonConvert();
 
@@ -62,14 +65,12 @@ class JsonConvert {
     }
   }
 
-  List<T?>? convertList<T>(List<dynamic>? value,
-      {EnumConvertFunction? enumConvert}) {
+  List<T?>? convertList<T>(List<dynamic>? value, {EnumConvertFunction? enumConvert}) {
     if (value == null) {
       return null;
     }
     try {
-      return value.map((dynamic e) => _asT<T>(e, enumConvert: enumConvert))
-          .toList();
+      return value.map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)).toList();
     } catch (e, stackTrace) {
       debugPrint('asT<$T> $e $stackTrace');
       if (onError != null) {
@@ -79,14 +80,12 @@ class JsonConvert {
     }
   }
 
-  List<T>? convertListNotNull<T>(dynamic value,
-      {EnumConvertFunction? enumConvert}) {
+  List<T>? convertListNotNull<T>(dynamic value, {EnumConvertFunction? enumConvert}) {
     if (value == null) {
       return null;
     }
     try {
-      return (value as List<dynamic>).map((dynamic e) =>
-      _asT<T>(e, enumConvert: enumConvert)!).toList();
+      return (value as List<dynamic>).map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)!).toList();
     } catch (e, stackTrace) {
       debugPrint('asT<$T> $e $stackTrace');
       if (onError != null) {
@@ -134,17 +133,39 @@ class JsonConvert {
           return covertFunc(Map<String, dynamic>.from(value)) as T;
         }
       } else {
-        throw UnimplementedError(
-            '$type unimplemented,you can try running the app again');
+        throw UnimplementedError('$type unimplemented,you can try running the app again');
       }
     }
   }
 
   //list is returned by type
   static M? _getListChildType<M>(List<Map<String, dynamic>> data) {
+    if (<AuthLoginEntity>[] is M) {
+      return data.map<AuthLoginEntity>((Map<String, dynamic> e) => AuthLoginEntity.fromJson(e)).toList() as M;
+    }
+    if (<CaptchaImgEntity>[] is M) {
+      return data.map<CaptchaImgEntity>((Map<String, dynamic> e) => CaptchaImgEntity.fromJson(e)).toList() as M;
+    }
     if (<ServerTime>[] is M) {
-      return data.map<ServerTime>((Map<String, dynamic> e) =>
-          ServerTime.fromJson(e)).toList() as M;
+      return data.map<ServerTime>((Map<String, dynamic> e) => ServerTime.fromJson(e)).toList() as M;
+    }
+    if (<UserMeEntity>[] is M) {
+      return data.map<UserMeEntity>((Map<String, dynamic> e) => UserMeEntity.fromJson(e)).toList() as M;
+    }
+    if (<UserMeHouseholds>[] is M) {
+      return data.map<UserMeHouseholds>((Map<String, dynamic> e) => UserMeHouseholds.fromJson(e)).toList() as M;
+    }
+    if (<UserMeEstates>[] is M) {
+      return data.map<UserMeEstates>((Map<String, dynamic> e) => UserMeEstates.fromJson(e)).toList() as M;
+    }
+    if (<UserMeEstatesAccounts>[] is M) {
+      return data.map<UserMeEstatesAccounts>((Map<String, dynamic> e) => UserMeEstatesAccounts.fromJson(e)).toList() as M;
+    }
+    if (<UserMeEstatesAccountsUnit>[] is M) {
+      return data.map<UserMeEstatesAccountsUnit>((Map<String, dynamic> e) => UserMeEstatesAccountsUnit.fromJson(e)).toList() as M;
+    }
+    if (<UserMeDefaultUnit>[] is M) {
+      return data.map<UserMeDefaultUnit>((Map<String, dynamic> e) => UserMeDefaultUnit.fromJson(e)).toList() as M;
     }
 
     debugPrint("$M not found");
@@ -157,8 +178,7 @@ class JsonConvert {
       return json;
     }
     if (json is List) {
-      return _getListChildType<M>(
-          json.map((dynamic e) => e as Map<String, dynamic>).toList());
+      return _getListChildType<M>(json.map((dynamic e) => e as Map<String, dynamic>).toList());
     } else {
       return jsonConvert.convert<M>(json);
     }
@@ -167,7 +187,15 @@ class JsonConvert {
 
 class JsonConvertClassCollection {
   Map<String, JsonConvertFunction> convertFuncMap = {
+    (AuthLoginEntity).toString(): AuthLoginEntity.fromJson,
+    (CaptchaImgEntity).toString(): CaptchaImgEntity.fromJson,
     (ServerTime).toString(): ServerTime.fromJson,
+    (UserMeEntity).toString(): UserMeEntity.fromJson,
+    (UserMeHouseholds).toString(): UserMeHouseholds.fromJson,
+    (UserMeEstates).toString(): UserMeEstates.fromJson,
+    (UserMeEstatesAccounts).toString(): UserMeEstatesAccounts.fromJson,
+    (UserMeEstatesAccountsUnit).toString(): UserMeEstatesAccountsUnit.fromJson,
+    (UserMeDefaultUnit).toString(): UserMeDefaultUnit.fromJson,
   };
 
   bool containsKey(String type) {

+ 40 - 0
packages/cs_domain/lib/generated/json/captcha_img_entity.g.dart

@@ -0,0 +1,40 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/captcha_img_entity.dart';
+
+CaptchaImgEntity $CaptchaImgEntityFromJson(Map<String, dynamic> json) {
+  final CaptchaImgEntity captchaImgEntity = CaptchaImgEntity();
+  final bool? sensitive = jsonConvert.convert<bool>(json['sensitive']);
+  if (sensitive != null) {
+    captchaImgEntity.sensitive = sensitive;
+  }
+  final String? key = jsonConvert.convert<String>(json['key']);
+  if (key != null) {
+    captchaImgEntity.key = key;
+  }
+  final String? img = jsonConvert.convert<String>(json['img']);
+  if (img != null) {
+    captchaImgEntity.img = img;
+  }
+  return captchaImgEntity;
+}
+
+Map<String, dynamic> $CaptchaImgEntityToJson(CaptchaImgEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['sensitive'] = entity.sensitive;
+  data['key'] = entity.key;
+  data['img'] = entity.img;
+  return data;
+}
+
+extension CaptchaImgEntityExtension on CaptchaImgEntity {
+  CaptchaImgEntity copyWith({
+    bool? sensitive,
+    String? key,
+    String? img,
+  }) {
+    return CaptchaImgEntity()
+      ..sensitive = sensitive ?? this.sensitive
+      ..key = key ?? this.key
+      ..img = img ?? this.img;
+  }
+}

+ 352 - 0
packages/cs_domain/lib/generated/json/user_me_entity.g.dart

@@ -0,0 +1,352 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/user_me_entity.dart';
+
+UserMeEntity $UserMeEntityFromJson(Map<String, dynamic> json) {
+  final UserMeEntity userMeEntity = UserMeEntity();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    userMeEntity.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    userMeEntity.name = name;
+  }
+  final String? avatar = jsonConvert.convert<String>(json['avatar']);
+  if (avatar != null) {
+    userMeEntity.avatar = avatar;
+  }
+  final String? phone = jsonConvert.convert<String>(json['phone']);
+  if (phone != null) {
+    userMeEntity.phone = phone;
+  }
+  final String? followsCount = jsonConvert.convert<String>(json['follows_count']);
+  if (followsCount != null) {
+    userMeEntity.followsCount = followsCount;
+  }
+  final String? flowersCount = jsonConvert.convert<String>(json['flowers_count']);
+  if (flowersCount != null) {
+    userMeEntity.flowersCount = flowersCount;
+  }
+  final String? postsCount = jsonConvert.convert<String>(json['posts_count']);
+  if (postsCount != null) {
+    userMeEntity.postsCount = postsCount;
+  }
+  final List<UserMeHouseholds>? households = (json['households'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<UserMeHouseholds>(e) as UserMeHouseholds).toList();
+  if (households != null) {
+    userMeEntity.households = households;
+  }
+  final List<UserMeEstates>? estates = (json['estates'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<UserMeEstates>(e) as UserMeEstates).toList();
+  if (estates != null) {
+    userMeEntity.estates = estates;
+  }
+  final UserMeDefaultUnit? defaultUnit = jsonConvert.convert<UserMeDefaultUnit>(json['default_unit']);
+  if (defaultUnit != null) {
+    userMeEntity.defaultUnit = defaultUnit;
+  }
+  return userMeEntity;
+}
+
+Map<String, dynamic> $UserMeEntityToJson(UserMeEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['avatar'] = entity.avatar;
+  data['phone'] = entity.phone;
+  data['follows_count'] = entity.followsCount;
+  data['flowers_count'] = entity.flowersCount;
+  data['posts_count'] = entity.postsCount;
+  data['households'] = entity.households?.map((v) => v.toJson()).toList();
+  data['estates'] = entity.estates?.map((v) => v.toJson()).toList();
+  data['default_unit'] = entity.defaultUnit?.toJson();
+  return data;
+}
+
+extension UserMeEntityExtension on UserMeEntity {
+  UserMeEntity copyWith({
+    String? id,
+    String? name,
+    String? avatar,
+    String? phone,
+    String? followsCount,
+    String? flowersCount,
+    String? postsCount,
+    List<UserMeHouseholds>? households,
+    List<UserMeEstates>? estates,
+    UserMeDefaultUnit? defaultUnit,
+  }) {
+    return UserMeEntity()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..avatar = avatar ?? this.avatar
+      ..phone = phone ?? this.phone
+      ..followsCount = followsCount ?? this.followsCount
+      ..flowersCount = flowersCount ?? this.flowersCount
+      ..postsCount = postsCount ?? this.postsCount
+      ..households = households ?? this.households
+      ..estates = estates ?? this.estates
+      ..defaultUnit = defaultUnit ?? this.defaultUnit;
+  }
+}
+
+UserMeHouseholds $UserMeHouseholdsFromJson(Map<String, dynamic> json) {
+  final UserMeHouseholds userMeHouseholds = UserMeHouseholds();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    userMeHouseholds.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    userMeHouseholds.name = name;
+  }
+  final String? avatar = jsonConvert.convert<String>(json['avatar']);
+  if (avatar != null) {
+    userMeHouseholds.avatar = avatar;
+  }
+  return userMeHouseholds;
+}
+
+Map<String, dynamic> $UserMeHouseholdsToJson(UserMeHouseholds entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['avatar'] = entity.avatar;
+  return data;
+}
+
+extension UserMeHouseholdsExtension on UserMeHouseholds {
+  UserMeHouseholds copyWith({
+    String? id,
+    String? name,
+    String? avatar,
+  }) {
+    return UserMeHouseholds()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..avatar = avatar ?? this.avatar;
+  }
+}
+
+UserMeEstates $UserMeEstatesFromJson(Map<String, dynamic> json) {
+  final UserMeEstates userMeEstates = UserMeEstates();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    userMeEstates.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    userMeEstates.name = name;
+  }
+  final List<UserMeEstatesAccounts>? accounts = (json['accounts'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<UserMeEstatesAccounts>(e) as UserMeEstatesAccounts).toList();
+  if (accounts != null) {
+    userMeEstates.accounts = accounts;
+  }
+  return userMeEstates;
+}
+
+Map<String, dynamic> $UserMeEstatesToJson(UserMeEstates entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['accounts'] = entity.accounts?.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension UserMeEstatesExtension on UserMeEstates {
+  UserMeEstates copyWith({
+    String? id,
+    String? name,
+    List<UserMeEstatesAccounts>? accounts,
+  }) {
+    return UserMeEstates()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..accounts = accounts ?? this.accounts;
+  }
+}
+
+UserMeEstatesAccounts $UserMeEstatesAccountsFromJson(Map<String, dynamic> json) {
+  final UserMeEstatesAccounts userMeEstatesAccounts = UserMeEstatesAccounts();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    userMeEstatesAccounts.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    userMeEstatesAccounts.name = name;
+  }
+  final String? avatar = jsonConvert.convert<String>(json['avatar']);
+  if (avatar != null) {
+    userMeEstatesAccounts.avatar = avatar;
+  }
+  final String? type = jsonConvert.convert<String>(json['type']);
+  if (type != null) {
+    userMeEstatesAccounts.type = type;
+  }
+  final int? isDefault = jsonConvert.convert<int>(json['default']);
+  if (isDefault != null) {
+    userMeEstatesAccounts.isDefault = isDefault;
+  }
+  final dynamic status = json['status'];
+  if (status != null) {
+    userMeEstatesAccounts.status = status;
+  }
+  final UserMeEstatesAccountsUnit? unit = jsonConvert.convert<UserMeEstatesAccountsUnit>(json['unit']);
+  if (unit != null) {
+    userMeEstatesAccounts.unit = unit;
+  }
+  return userMeEstatesAccounts;
+}
+
+Map<String, dynamic> $UserMeEstatesAccountsToJson(UserMeEstatesAccounts entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['avatar'] = entity.avatar;
+  data['type'] = entity.type;
+  data['default'] = entity.isDefault;
+  data['status'] = entity.status;
+  data['unit'] = entity.unit?.toJson();
+  return data;
+}
+
+extension UserMeEstatesAccountsExtension on UserMeEstatesAccounts {
+  UserMeEstatesAccounts copyWith({
+    String? id,
+    String? name,
+    String? avatar,
+    String? type,
+    int? isDefault,
+    dynamic status,
+    UserMeEstatesAccountsUnit? unit,
+  }) {
+    return UserMeEstatesAccounts()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..avatar = avatar ?? this.avatar
+      ..type = type ?? this.type
+      ..isDefault = isDefault ?? this.isDefault
+      ..status = status ?? this.status
+      ..unit = unit ?? this.unit;
+  }
+}
+
+UserMeEstatesAccountsUnit $UserMeEstatesAccountsUnitFromJson(Map<String, dynamic> json) {
+  final UserMeEstatesAccountsUnit userMeEstatesAccountsUnit = UserMeEstatesAccountsUnit();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    userMeEstatesAccountsUnit.id = id;
+  }
+  final String? block = jsonConvert.convert<String>(json['block']);
+  if (block != null) {
+    userMeEstatesAccountsUnit.block = block;
+  }
+  final String? street = jsonConvert.convert<String>(json['street']);
+  if (street != null) {
+    userMeEstatesAccountsUnit.street = street;
+  }
+  final String? unit = jsonConvert.convert<String>(json['unit']);
+  if (unit != null) {
+    userMeEstatesAccountsUnit.unit = unit;
+  }
+  final String? address = jsonConvert.convert<String>(json['address']);
+  if (address != null) {
+    userMeEstatesAccountsUnit.address = address;
+  }
+  return userMeEstatesAccountsUnit;
+}
+
+Map<String, dynamic> $UserMeEstatesAccountsUnitToJson(UserMeEstatesAccountsUnit entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['block'] = entity.block;
+  data['street'] = entity.street;
+  data['unit'] = entity.unit;
+  data['address'] = entity.address;
+  return data;
+}
+
+extension UserMeEstatesAccountsUnitExtension on UserMeEstatesAccountsUnit {
+  UserMeEstatesAccountsUnit copyWith({
+    String? id,
+    String? block,
+    String? street,
+    String? unit,
+    String? address,
+  }) {
+    return UserMeEstatesAccountsUnit()
+      ..id = id ?? this.id
+      ..block = block ?? this.block
+      ..street = street ?? this.street
+      ..unit = unit ?? this.unit
+      ..address = address ?? this.address;
+  }
+}
+
+UserMeDefaultUnit $UserMeDefaultUnitFromJson(Map<String, dynamic> json) {
+  final UserMeDefaultUnit userMeDefaultUnit = UserMeDefaultUnit();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    userMeDefaultUnit.id = id;
+  }
+  final String? estateId = jsonConvert.convert<String>(json['estate_id']);
+  if (estateId != null) {
+    userMeDefaultUnit.estateId = estateId;
+  }
+  final String? block = jsonConvert.convert<String>(json['block']);
+  if (block != null) {
+    userMeDefaultUnit.block = block;
+  }
+  final String? street = jsonConvert.convert<String>(json['street']);
+  if (street != null) {
+    userMeDefaultUnit.street = street;
+  }
+  final String? unit = jsonConvert.convert<String>(json['unit']);
+  if (unit != null) {
+    userMeDefaultUnit.unit = unit;
+  }
+  final String? address = jsonConvert.convert<String>(json['address']);
+  if (address != null) {
+    userMeDefaultUnit.address = address;
+  }
+  final int? type = jsonConvert.convert<int>(json['type']);
+  if (type != null) {
+    userMeDefaultUnit.type = type;
+  }
+  return userMeDefaultUnit;
+}
+
+Map<String, dynamic> $UserMeDefaultUnitToJson(UserMeDefaultUnit entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['estate_id'] = entity.estateId;
+  data['block'] = entity.block;
+  data['street'] = entity.street;
+  data['unit'] = entity.unit;
+  data['address'] = entity.address;
+  data['type'] = entity.type;
+  return data;
+}
+
+extension UserMeDefaultUnitExtension on UserMeDefaultUnit {
+  UserMeDefaultUnit copyWith({
+    String? id,
+    String? estateId,
+    String? block,
+    String? street,
+    String? unit,
+    String? address,
+    int? type,
+  }) {
+    return UserMeDefaultUnit()
+      ..id = id ?? this.id
+      ..estateId = estateId ?? this.estateId
+      ..block = block ?? this.block
+      ..street = street ?? this.street
+      ..unit = unit ?? this.unit
+      ..address = address ?? this.address
+      ..type = type ?? this.type;
+  }
+}

+ 147 - 0
packages/cs_domain/lib/repository/auth_repository.dart

@@ -0,0 +1,147 @@
+import 'package:domain/entity/auth_login_entity.dart';
+import 'package:domain/entity/captcha_img_entity.dart';
+import 'package:domain/entity/server_time.dart';
+import 'package:plugin_platform/platform_export.dart';
+import 'package:plugin_platform/http/dio_engine.dart';
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/util.dart';
+
+import '../constants/api_constants.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+part 'auth_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+AuthRepository authRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return AuthRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 用户模块的数据仓库
+ */
+class AuthRepository {
+  DioEngine dioEngine;
+
+  AuthRepository({required this.dioEngine});
+
+  /// 用户登录
+  Future<HttpResult<AuthLoginEntity>> authLogin(
+    String? userName,
+    String? password, {
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+
+    params['username'] = userName!;
+    params['password'] = password!;
+
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiUserLogin,
+      params: params,
+      method: HttpMethod.POST,
+      isShowLoadingDialog: true,
+      networkDebounce: true,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = AuthLoginEntity.fromJson(json!);
+      return result.convert<AuthLoginEntity>(data: data);
+    }
+    return result.convert();
+  }
+
+  /// 图片验证码
+  Future<HttpResult<CaptchaImgEntity>> fetchCaptchaImage({
+    CancelToken? cancelToken,
+  }) async {
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiCaptchaImage,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,
+      networkDebounce: true,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = CaptchaImgEntity.fromJson(json!);
+      return result.convert<CaptchaImgEntity>(data: data);
+    }
+    return result.convert();
+  }
+
+  /// 发送短信
+  Future<HttpResult> sendSMS({
+    required String? countryCode,
+    required String? phone,
+    required String? captchaKey,
+    required String? captchaValue,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+
+    params['country_code'] = countryCode!;
+    params['phone'] = phone!;
+    params['captcha_key'] = captchaKey!;
+    params['captcha_value'] = captchaValue!;
+
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiSendSMS,
+      params: params,
+      method: HttpMethod.POST,
+      isShowLoadingDialog: true,
+      networkDebounce: true,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      return result.convert();
+    }
+    return result.convert();
+  }
+
+  /// 用户注册
+  Future<HttpResult<AuthLoginEntity>> userRegister({
+    required String firstName,
+    required String lastName,
+    required String email,
+    required String countryCode,
+    required String phone,
+    required String password,
+    required String confirmPassword,
+    required String? smsCode,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+
+    params['first_name'] = firstName;
+    params['last_name'] = lastName;
+    params['email'] = email;
+    params['country_code'] = countryCode;
+    params['phone'] = phone;
+    params['password'] = password;
+    params['password_confirmation'] = confirmPassword;
+    params['sms_code'] = smsCode ?? "";
+
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiAuthRegister,
+      params: params,
+      method: HttpMethod.POST,
+      isShowLoadingDialog: true,
+      networkDebounce: true,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = AuthLoginEntity.fromJson(json!);
+      return result.convert<AuthLoginEntity>(data: data);
+    }
+    return result.convert();
+  }
+}

+ 27 - 0
packages/cs_domain/lib/repository/auth_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'auth_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$authRepositoryHash() => r'c47dc3a04d33b66a90d3c9d7749a5d51a5fbf199';
+
+/// See also [authRepository].
+@ProviderFor(authRepository)
+final authRepositoryProvider = Provider<AuthRepository>.internal(
+  authRepository,
+  name: r'authRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$authRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef AuthRepositoryRef = ProviderRef<AuthRepository>;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 30 - 0
packages/cs_domain/lib/repository/main_repository.dart

@@ -0,0 +1,30 @@
+import 'package:domain/entity/auth_login_entity.dart';
+import 'package:domain/entity/server_time.dart';
+import 'package:plugin_platform/platform_export.dart';
+import 'package:plugin_platform/http/dio_engine.dart';
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/util.dart';
+
+import '../constants/api_constants.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+part 'main_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+MainRepository mainRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return MainRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 首页的数据仓库
+ */
+class MainRepository {
+  DioEngine dioEngine;
+
+  MainRepository({required this.dioEngine});
+
+
+}

+ 27 - 0
packages/cs_domain/lib/repository/main_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'main_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$mainRepositoryHash() => r'2f4451313dce1de462708eed1188ee6cf5aa8e18';
+
+/// See also [mainRepository].
+@ProviderFor(mainRepository)
+final mainRepositoryProvider = Provider<MainRepository>.internal(
+  mainRepository,
+  name: r'mainRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$mainRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef MainRepositoryRef = ProviderRef<MainRepository>;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 45 - 0
packages/cs_domain/lib/repository/profile_repository.dart

@@ -0,0 +1,45 @@
+import 'package:domain/entity/user_me_entity.dart';
+import 'package:plugin_platform/platform_export.dart';
+import 'package:plugin_platform/http/dio_engine.dart';
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/util.dart';
+import '../constants/api_constants.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+part 'profile_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+ProfileRepository profileRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return ProfileRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 用户详情的数据仓库
+ */
+class ProfileRepository {
+  DioEngine dioEngine;
+
+  ProfileRepository({required this.dioEngine});
+
+  /// 获取用户详情
+  Future<HttpResult<UserMeEntity>> fetchUserInfo({
+    CancelToken? cancelToken,
+  }) async {
+
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiProfileInfo,
+      method: HttpMethod.GET,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = UserMeEntity.fromJson(json!);
+      return result.convert<UserMeEntity>(data: data);
+    }
+    return result.convert();
+  }
+}

+ 27 - 0
packages/cs_domain/lib/repository/profile_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'profile_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$profileRepositoryHash() => r'b561be8d75f11602036430c625a432d1c522d99e';
+
+/// See also [profileRepository].
+@ProviderFor(profileRepository)
+final profileRepositoryProvider = Provider<ProfileRepository>.internal(
+  profileRepository,
+  name: r'profileRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$profileRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef ProfileRepositoryRef = ProviderRef<ProfileRepository>;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 5 - 3
packages/cs_plugin_basic/lib/constants/app_constant.dart

@@ -1,5 +1,6 @@
 // ignore_for_file: constant_identifier_names
 // ignore: non_constant_identifier_names
+import 'package:domain/constants/api_constants.dart';
 import 'package:flutter/foundation.dart';
 import 'package:flutter/material.dart';
 
@@ -18,8 +19,9 @@ class AppConstant {
   static const storageDarkModel = 'storage_dark_model'; //设备当前配置的模式
 
   //消息通知Key
-  static const eventProfile2Refresh = 'event_profile_refresh'; //通知用户信息需要刷新
-  static const eventLabourRequestRefresh = 'event_labour_request_refresh'; //用工请求的列表刷新
-  static const eventAppliedListRefresh = 'event_applied_list_refresh'; //已申请的列表刷新
+  static const eventProfileRefresh = 'event_profile_refresh'; //通知用户信息需要刷新
+
+  //手机短信的国家区号
+  static const countryCode = ApiConstants.isServerRelease ? "65" : "86"; //(测试环境为+86,正式环境为+65)
 
 }

+ 19 - 18
packages/cs_widgets/lib/dialog/verify_code_dialog.dart

@@ -1,15 +1,17 @@
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:domain/repository/auth_repository.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
+import 'package:plugin_basic/dialog/verify_code_view_model.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_load_image.dart';
-import '../my_text_field.dart';
-import '../my_text_view.dart';
 import 'dart:ui';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/widgets.dart';
+import 'package:widgets/my_text_field.dart';
+import 'package:widgets/my_text_view.dart';
 import 'package:widgets/widget_export.dart';
 
 import 'package:flutter_hooks/flutter_hooks.dart';
@@ -19,7 +21,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
  * 验证码校验弹窗,输入四位数的验证才能发送短信
  */
 class VerifyCodeDialog extends HookConsumerWidget {
-  void Function(String key, String code) confirmAction;
+  void Function(String? key, String? code) confirmAction;
 
   VerifyCodeDialog({
     required this.confirmAction,
@@ -28,17 +30,15 @@ class VerifyCodeDialog extends HookConsumerWidget {
   @override
   Widget build(BuildContext context, WidgetRef ref) {
     // 使用 useState 来持久化 TextEditingController 和 FocusNode
-    final textEditingController = useTextEditingController();
-    final focusNode = useFocusNode();
+    final viewModel = ref.watch(verifyCodeProvider.notifier);
+    final state = ref.watch(verifyCodeProvider);
 
     useEffect(() {
       //赋值State的值
-      Future.microtask(() {});
-
+      Future.microtask(() {
+        viewModel.fetchCode();
+      });
       return () {
-        // 释放控制器资源
-        textEditingController.dispose();
-        focusNode.dispose();
       };
     }, []);
 
@@ -110,8 +110,8 @@ class VerifyCodeDialog extends HookConsumerWidget {
                         fontSize: 16,
                         fontWeight: FontWeight.w500,
                       ),
-                      controller: textEditingController,
-                      focusNode: focusNode,
+                      controller: state.textEditingController,
+                      focusNode: state.focusNode,
                       style: TextStyle(
                         color: context.appColors.authFiledText,
                         fontSize: 16,
@@ -122,21 +122,22 @@ class VerifyCodeDialog extends HookConsumerWidget {
                       cursorColor: context.appColors.authFiledText,
                       margin: const EdgeInsets.only(right: 5),
                       onSubmit: (formKey, value) {
-                        focusNode.unfocus();
+                        state.focusNode.unfocus();
+                        confirmAction.call(state.key, state.textEditingController.text.toString());
                         onCancel();
-                        confirmAction.call("key", textEditingController.text.toString());
                       },
                     ),
                   ).expanded(),
 
                   //图片验证码
                   MyLoadImage(
-                    'https://img0.baidu.com/it/u=3528227727,3536117093&fm=253&fmt=auto&app=138&f=JPEG?w=395&h=200',
+                    state.imgFilePath,
                     width: 100,
                     height: 45,
                     fit: BoxFit.fill,
                     onClick: () {
                       //刷新验证码
+                      viewModel.fetchCode();
                     },
                   ),
                 ],
@@ -147,12 +148,12 @@ class VerifyCodeDialog extends HookConsumerWidget {
                 children: [
                   InkWell(
                     onTap: () async {
-                      focusNode.unfocus();
+                      state.focusNode.unfocus();
+                      confirmAction.call(state.key, state.textEditingController.text.toString());
                       onCancel();
-                      confirmAction.call("key", textEditingController.text.toString());
                     },
                     child: MyTextView(
-                      S.current.get_code,
+                      S.current.get_verification_code,
                       fontSize: 16,
                       paddingTop: 13,
                       paddingBottom: 13,

+ 24 - 0
packages/cs_plugin_basic/lib/dialog/verify_code_state.dart

@@ -0,0 +1,24 @@
+import 'package:flutter/material.dart';
+
+class verifyCodeState {
+  final textEditingController = TextEditingController();
+  final focusNode = FocusNode();
+
+  final String? key;
+  final String? imgFilePath;
+
+  verifyCodeState({
+    this.key,
+    this.imgFilePath,
+  });
+
+  verifyCodeState copyWith({
+    String? key,
+    String? imgFilePath,
+  }) {
+    return verifyCodeState(
+      key: key ?? this.key,
+      imgFilePath: imgFilePath ?? this.imgFilePath,
+    );
+  }
+}

+ 63 - 0
packages/cs_plugin_basic/lib/dialog/verify_code_view_model.dart

@@ -0,0 +1,63 @@
+import 'dart:convert';
+import 'dart:io';
+
+import 'package:domain/repository/auth_repository.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_platform/engine/directory/directory_util.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
+import 'package:shared/utils/log_utils.dart';
+
+import 'verify_code_state.dart';
+
+class VerifyCodeViewModel extends AutoDisposeNotifier<verifyCodeState> with DioCancelableMixin {
+  late final AuthRepository authRepository;
+
+  @override
+  verifyCodeState build() {
+    authRepository = ref.read(authRepositoryProvider);
+
+    final state = verifyCodeState();
+
+    registerCancellation(callback: () {
+      _clearCachedImage();
+    });
+    return state;
+  }
+
+  ///获取验证码
+  void fetchCode() async {
+    final result = await authRepository.fetchCaptchaImage(cancelToken: cancelToken);
+
+    //Base64转为本地图片缓存
+    final bytes = base64.decode(result.data?.img?.replaceFirst('data:image/png;base64,', '') ?? '');
+    final tempDir = DirectoryUtil.getTempPath();
+    final file = File('$tempDir/verify${DateTime.now().millisecondsSinceEpoch}.png');
+    await file.writeAsBytes(bytes);
+    Log.d('存入的File路径为:${file.path}');
+
+    if (result.isSuccess) {
+      state = state.copyWith(key: result.data?.key, imgFilePath: file.path);
+    } else {
+      ToastEngine.show(result.errorMsg ?? "UnKnow Error");
+    }
+  }
+
+  // 清除缓存的verify验证图形码的缓存文件
+  Future<void> _clearCachedImage() async {
+    final cacheDir = await DirectoryUtil.initTempDir();
+    if (cacheDir != null) {
+      if (await cacheDir.exists()) {
+        //遍历删除 Cache 目录下面的全部文件或文件夹
+        for (final entity in cacheDir.listSync()) {
+          // 如果是指定的文件直接删除
+          if (entity is File && entity.path.split('/').last.startsWith("verify")) {
+            await entity.delete();
+          }
+        }
+      }
+    }
+  }
+}
+
+final verifyCodeProvider = NotifierProvider.autoDispose<VerifyCodeViewModel, verifyCodeState>(VerifyCodeViewModel.new);

+ 4 - 1
packages/cs_plugin_basic/lib/dio_interceptors/interceptor_auth_dio.dart

@@ -19,6 +19,10 @@ class AuthDioInterceptors extends Interceptor {
       headers['accept'] = 'application/json';
     }
 
+    if (Utils.isEmpty(headers['Content-Type'])) {
+      headers['Content-Type'] = 'application/x-www-form-urlencoded';
+    }
+
     // 设置需要添加平台信息,App版本信息等
     if (DeviceUtils.isIOS) {  
       final systemVersion = AppConfigService.getState().iosDeviceInfo?.systemVersion;
@@ -47,7 +51,6 @@ class AuthDioInterceptors extends Interceptor {
 
     //如果有通行令牌,都带上通行令牌
     String? token = UserConfigService.getState().token;
-    Log.d("AuthDioInterceptors 添加用户授权Token:$token");
     if (!Utils.isEmpty(token)) {
       headers['Authorization'] = 'Bearer $token';
     }

+ 6 - 30
packages/cs_plugin_basic/lib/provider/user_config/user_config.dart

@@ -1,8 +1,9 @@
 // 用户相关的操作状态 State 类,用于 RiverPod 中 Provider 的定义
+import 'package:domain/entity/user_me_entity.dart';
+
 class UserConfig {
   //用户的详情信息
-  // UserProfile userProfile;
-  String? userName;
+  UserMeEntity? user;
 
   //用户的登录Token
   String? token;
@@ -20,47 +21,22 @@ class UserConfig {
 
 //<editor-fold desc="Data Methods">
   UserConfig({
-    this.userName,
+    this.user,
     this.token,
     required this.haslogin,
     this.registrationId,
     required this.unreadNotificationsCount,
   });
 
-  @override
-  bool operator ==(Object other) =>
-      identical(this, other) ||
-      (other is UserConfig &&
-          runtimeType == other.runtimeType &&
-          userName == other.userName &&
-          token == other.token &&
-          haslogin == other.haslogin &&
-          registrationId == other.registrationId &&
-          unreadNotificationsCount == other.unreadNotificationsCount);
-
-  @override
-  int get hashCode => userName.hashCode ^ token.hashCode ^ haslogin.hashCode ^ registrationId.hashCode ^ unreadNotificationsCount.hashCode;
-
-  @override
-  String toString() {
-    return 'UserConfig{' +
-        ' userName: $userName,' +
-        ' token: $token,' +
-        ' haslogin: $haslogin,' +
-        ' registrationId: $registrationId,' +
-        ' unreadNotificationsCount: $unreadNotificationsCount,' +
-        '}';
-  }
-
   UserConfig copyWith({
-    String? userName,
+    UserMeEntity? user,
     String? token,
     bool? haslogin,
     String? registrationId,
     int? unreadNotificationsCount,
   }) {
     return UserConfig(
-      userName: userName ?? this.userName,
+      user: user ?? this.user,
       token: token ?? this.token,
       haslogin: haslogin ?? this.haslogin,
       registrationId: registrationId ?? this.registrationId,

+ 20 - 6
packages/cs_plugin_basic/lib/provider/user_config/user_config_service.dart

@@ -1,5 +1,7 @@
 import 'dart:ffi';
 
+import 'package:domain/entity/user_me_entity.dart';
+import 'package:domain/repository/profile_repository.dart';
 import 'package:flutter_riverpod/flutter_riverpod.dart';
 import 'package:plugin_basic/provider/user_config/user_config.dart';
 import 'package:plugin_platform/engine/sp/sp_util.dart';
@@ -17,6 +19,7 @@ part 'user_config_service.g.dart';
  */
 @Riverpod(keepAlive: true)
 class UserConfigService extends _$UserConfigService {
+  late final ProfileRepository profileRepository;
 
   /// 静态方法获取当前单例对象
   static UserConfigService getInstance({WidgetRef? ref}) {
@@ -27,7 +30,7 @@ class UserConfigService extends _$UserConfigService {
     }
   }
 
-  static UserConfig getState({WidgetRef? ref}){
+  static UserConfig getState({WidgetRef? ref}) {
     if (ref != null) {
       return ref.watch(userConfigServiceProvider);
     } else {
@@ -37,14 +40,26 @@ class UserConfigService extends _$UserConfigService {
 
   @override
   UserConfig build() {
+    profileRepository = ref.read(profileRepositoryProvider);
+
     String? token = SPUtil.getString(AppConstant.storageToken);
     Log.d('UserService - 查询SP token:$token 并赋值');
-    return UserConfig(token: token, haslogin: false, registrationId: null, unreadNotificationsCount: 0);
+    return UserConfig(token: token, haslogin: Utils.isNotEmpty(token), registrationId: null, unreadNotificationsCount: 0);
+  }
+
+  /// 静默请求用户的详情数据
+  void refreshUserInfo() async {
+    final result = await profileRepository.fetchUserInfo();
+    if (result.isSuccess) {
+      setUserInfo(result.data);
+    } else {
+      Log.e(result.errorMsg ?? "UnKnow Error");
+    }
   }
 
   /// 设置用户信息
-  void setUserInfo(String? userName){
-    state = state.copyWith(userName: userName);
+  void setUserInfo(UserMeEntity? user) {
+    state = state.copyWith(user: user);
   }
 
   /// 设置全局的Token,同时更新 hasLogin 的值,赋值时机如下
@@ -67,7 +82,6 @@ class UserConfigService extends _$UserConfigService {
   /// 处理退出登录之后的数据清除
   void handleLogoutParams() {
     SPUtil.remove(AppConstant.storageToken);
-    state = state.copyWith(haslogin: false);
-    // hotelInfo = HotelInfoEntity();
+    state = state.copyWith(token: null, haslogin: false, registrationId: null, unreadNotificationsCount: 0, user: null);
   }
 }

+ 9 - 11
packages/cs_plugin_platform/lib/http/dio/dio_cancelable_mixin.dart

@@ -3,21 +3,19 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
 
 /*
  * 用于 UI Page 对应的Controller 混入,可以在关闭页面的时候自动取消网络请求
- * 是否需要使用状态泛型??
+ * 是否需要使用状态泛型
  */
-mixin DioCancelableMixin on AutoDisposeNotifier {
-  final CancelToken _cancelToken = CancelToken();
+mixin DioCancelableMixin<T> on AutoDisposeNotifier<T> {
+  final CancelToken cancelToken = CancelToken();
 
-  @override
-  void build() {
-    super.build();
-
-    // 注册一个回调函数,在对象被释放时调用
+  //需要手动的调用取消的注册
+  void registerCancellation({void Function()? callback}) {
     ref.onDispose(() {
-      if (!_cancelToken.isCancelled) {
-        _cancelToken.cancel("Request cancelled due to AutoDisposeNotifier being disposed.");
+      callback?.call();
+
+      if (!cancelToken.isCancelled) {
+        cancelToken.cancel("Request cancelled due to AutoDisposeNotifier being disposed.");
       }
     });
   }
-
 }

+ 5 - 0
packages/cs_resources/lib/generated/intl/messages_en.dart

@@ -174,6 +174,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "get_code": MessageLookupByLibrary.simpleMessage("Get Code"),
         "get_started":
             MessageLookupByLibrary.simpleMessage("let\'s get started"),
+        "get_verification_code":
+            MessageLookupByLibrary.simpleMessage("Get Verification Code"),
         "guest_mobile_number":
             MessageLookupByLibrary.simpleMessage("GUEST MOBILE NUMBER"),
         "guest_name": MessageLookupByLibrary.simpleMessage("GUEST NAME"),
@@ -346,6 +348,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "send_feedback_management": MessageLookupByLibrary.simpleMessage(
             "If you would like more information,please send a feedback to the Management"),
         "send_on_sometime": m5,
+        "send_sms_successful": MessageLookupByLibrary.simpleMessage(
+            "Sending SMS successfully, please enter SMS verification code"),
         "sent": MessageLookupByLibrary.simpleMessage("Sent"),
         "serial_number": MessageLookupByLibrary.simpleMessage("Serial Number"),
         "service": MessageLookupByLibrary.simpleMessage("Service"),
@@ -378,6 +382,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "strata_management_guides":
             MessageLookupByLibrary.simpleMessage("Strata Management Guides"),
         "submit": MessageLookupByLibrary.simpleMessage("Submit"),
+        "successful": MessageLookupByLibrary.simpleMessage("Successful"),
         "tenant": MessageLookupByLibrary.simpleMessage("Tenant"),
         "tenants_desc1": MessageLookupByLibrary.simpleMessage(
             "My name is in the lease agreement"),

+ 30 - 0
packages/cs_resources/lib/generated/l10n.dart

@@ -2690,6 +2690,36 @@ class S {
     );
   }
 
+  /// `Successful`
+  String get successful {
+    return Intl.message(
+      'Successful',
+      name: 'successful',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Sending SMS successfully, please enter SMS verification code`
+  String get send_sms_successful {
+    return Intl.message(
+      'Sending SMS successfully, please enter SMS verification code',
+      name: 'send_sms_successful',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Get Verification Code`
+  String get get_verification_code {
+    return Intl.message(
+      'Get Verification Code',
+      name: 'get_verification_code',
+      desc: '',
+      args: [],
+    );
+  }
+
   /// `Other`
   String get other {
     return Intl.message(

+ 3 - 0
packages/cs_resources/lib/l10n/intl_en.arb

@@ -263,5 +263,8 @@
   "enter_captcha": "Enter CAPTCHA",
   "captcha": "CAPTCHA",
   "rejected": "Rejected",
+  "successful": "Successful",
+  "send_sms_successful": "Sending SMS successfully, please enter SMS verification code",
+  "get_verification_code": "Get Verification Code",
   "other": "Other"
 }

+ 3 - 0
packages/cs_resources/lib/l10n/intl_zh_CN.arb

@@ -263,5 +263,8 @@
   "enter_captcha": "输入验证码",
   "captcha": "验证码",
   "rejected": "已拒绝",
+  "successful": "成功",
+  "send_sms_successful": "发送短信成功,请输入短信验证码",
+  "get_verification_code": "获取短信验证码",
   "other": "其他"
 }

+ 3 - 0
packages/cs_resources/lib/l10n/intl_zh_HK.arb

@@ -249,5 +249,8 @@
   "enter_captcha": "输入验证码",
   "captcha": "验证码",
   "rejected": "已拒绝",
+  "successful": "成功",
+  "send_sms_successful": "发送短信成功,请输入短信验证码",
+  "get_verification_code": "获取短信验证码",
   "other": "其他"
 }

+ 2 - 0
packages/cs_router/lib/componentRouter/auth_service.dart

@@ -5,5 +5,7 @@ abstract class AuthService {
 
   void startLoginPage();
 
+  void startAndPopAllLoginPage();
+
   void startSelectEstatePage();
 }

+ 1 - 2
packages/cs_widgets/lib/widget_export.dart

@@ -6,5 +6,4 @@ export 'package:easy_refresh/easy_refresh.dart';
 export 'package:flutter_html/flutter_html.dart';
 export 'package:webview_flutter/webview_flutter.dart';
 export 'package:hand_signature/signature.dart';
-export 'shatter/weekly_calendar/weekly_calendar.dart';
-export 'dialog/verify_code_dialog.dart';
+export 'shatter/weekly_calendar/weekly_calendar.dart';