浏览代码

Update 代码优化,

Yue 1 月之前
父节点
当前提交
23a94dbd36

+ 1 - 1
UI/CF.APP/chicken_farm/.env/.env.prod

@@ -1,7 +1,7 @@
 APP_ENV=prod
 APP_NAME=养殖场管理系统
 APP_VERSION=1.0.0
-BASE_API_URL=http://shvber.com:5067
+BASE_API_URL=http://shvber.com:5068
 CLIENT_ID=35aee70ae7224eb9a48bc527955ddedc
 IS_OFFLINE=false
 IS_PDA=true

+ 1 - 1
UI/CF.APP/chicken_farm/.env/.env.prod_no_pda

@@ -1,7 +1,7 @@
 APP_ENV=prod.no_pda
 APP_NAME=养殖场管理系统
 APP_VERSION=1.0.0
-BASE_API_URL=http://shvber.com:5067
+BASE_API_URL=http://shvber.com:5068
 CLIENT_ID=35aee70ae7224eb9a48bc527955ddedc
 IS_OFFLINE=false
 IS_PDA=false

+ 1 - 1
UI/CF.APP/chicken_farm/.env/.env.prod_offline

@@ -1,7 +1,7 @@
 APP_ENV=prod.offline
 APP_NAME=养殖场管理系统(脱机)
 APP_VERSION=1.0.0
-BASE_API_URL=http://shvber.com:5067
+BASE_API_URL=http://shvber.com:5068
 CLIENT_ID=35aee70ae7224eb9a48bc527955ddedc
 IS_OFFLINE=true
 IS_PDA=true

+ 1 - 1
UI/CF.APP/chicken_farm/.scripts/_build_cmd.txt

@@ -3,7 +3,7 @@ flutter build apk --target-platform android-arm
 mkdir -p release/app
 
 flutter build apk --target-platform android-arm --dart-define-from-file .env/.env.prod_no_pda --verbose
-copy build\app\outputs\flutter-apk\app-release.apk release\app\cf-app.apk
+copy build\app\outputs\flutter-apk\app-release.apk release\app\no_pda_cf-app.apk
 
 flutter build apk --target-platform android-arm --dart-define-from-file .env/.env.prod --verbose
 copy build\app\outputs\flutter-apk\app-release.apk release\app\pda_cf-app.apk

+ 3 - 3
UI/CF.APP/chicken_farm/lib/core/config/env/env_config.dart

@@ -13,11 +13,11 @@ class EnvConfig {
   );
   static const String baseApiUrl = String.fromEnvironment(
     "BASE_API_URL",
-    defaultValue: "'http://192.168.0.81:8380",
+    defaultValue: "http://192.168.0.81:8380",
   );
   static const String clientId = String.fromEnvironment(
     "CLIENT_ID",
-    defaultValue: "'35aee70ae7224eb9a48bc527955ddedc",
+    defaultValue: "35aee70ae7224eb9a48bc527955ddedc",
   );
   static const bool isOffline =
       String.fromEnvironment("IS_OFFLINE", defaultValue: "false") == "true";
@@ -28,4 +28,4 @@ class EnvConfig {
     "WIN_DB_PATH",
     defaultValue: ".demo/data",
   );
-}
+}

+ 1 - 1
UI/CF.APP/chicken_farm/lib/core/errors/error_handler.dart

@@ -26,7 +26,7 @@ class ErrorHandler {
         return NetworkError(message: "网络连接错误,请检查网络");
       case DioExceptionType.badResponse:
         final statusCode = error.response?.statusCode;
-        final errorMessage = error.response?.data['message'] ?? "服务器错误";
+        final errorMessage = "服务器错误[$statusCode]";
 
         if (statusCode == 401) {
           return AuthError(message: "认证失败,请重新登录", statusCode: statusCode);

+ 0 - 3
UI/CF.APP/chicken_farm/lib/pages/home/_profile/clear_cache_button.dart

@@ -2,7 +2,6 @@ import 'package:chicken_farm/core/utils/storage.dart';
 import 'package:chicken_farm/core/utils/toast.dart';
 import 'package:chicken_farm/stores/config_store.dart';
 import 'package:chicken_farm/stores/dict_stroe.dart';
-import 'package:chicken_farm/test/test.dart';
 import 'package:flutter/material.dart';
 
 class ClearCacheButton extends StatelessWidget {
@@ -14,8 +13,6 @@ class ClearCacheButton extends StatelessWidget {
       width: double.infinity,
       child: ElevatedButton.icon(
         onPressed: () {
-          Test().insetTestData();
-
           ToastUtil.confirm('确定要清除所有缓存吗?', () async {
             await StorageUtils.removeWithPrefix("vb_");
             ConfigStore().clearAll();

+ 2 - 1
UI/CF.APP/chicken_farm/lib/pages/home/profile.dart

@@ -102,6 +102,7 @@ class ProfilePage extends ConsumerWidget {
                   ],
                   Text(
                     _buildVersionText(),
+                    textAlign: TextAlign.center,
                     style: TextStyle(fontSize: 12, color: Colors.grey),
                   ),
                 ],
@@ -119,6 +120,6 @@ class ProfilePage extends ConsumerWidget {
 
     final deviceInfo = Platform.isAndroid ? "$deviceType$mode" : "WIN$mode";
 
-    return 'ChickenFarm $deviceInfo Powered by IWB ©2025';
+    return 'ChickenFarm $deviceInfo Powered by IWB ©2025 \nVersion: ${AppConfig.appVersion}';
   }
 }