Ver Fonte

feat(V1.0.5.B): 优化buff扫货功能和构建脚本

Made-with: Cursor
wuzilong há 6 meses atrás
pai
commit
e98b8642bc

+ 3 - 3
backend-client-bak/app/API日志记录功能使用指南.md

@@ -38,7 +38,7 @@ backend-client/
 ```json
 {
     "timestamp": "2026-02-02 18:30:45.123",  // 时间戳(精确到毫秒)
-    "endpoint": "http://192.168.2.54:9000/api/v1/auth/login",  // 接口路径
+    "endpoint": "http://125.122.32.114:9000/api/v1/auth/login",  // 接口路径
     "method": "POST",                         // HTTP方法
     "user_id": 1,                             // 用户ID(可为null)
     "client_ip": "192.168.1.100",             // 客户端IP
@@ -202,8 +202,8 @@ loguru_logger.add(
 控制台会同时输出简化的日志信息:
 
 ```
-[API请求] POST http://192.168.2.54:9000/api/v1/auth/login - 请求数据(密文): eyJ...
-[API响应] POST http://192.168.2.54:9000/api/v1/auth/login - 响应数据(密文): eyJ... - 执行时间: 105ms
+[API请求] POST http://125.122.32.114:9000/api/v1/auth/login - 请求数据(密文): eyJ...
+[API响应] POST http://125.122.32.114:9000/api/v1/auth/login - 响应数据(密文): eyJ... - 执行时间: 105ms
 ```
 
 ### 3. 文件日志

+ 2 - 2
backend-client-bak/start.ps1

@@ -69,8 +69,8 @@ if ($connection) {
 }
 
 Write-Host ""
-Write-Host "API地址: http://192.168.2.54:9000" -ForegroundColor $CYAN
-Write-Host "API文档: http://192.168.2.54:9000/docs" -ForegroundColor $CYAN
+Write-Host "API地址: http://125.122.32.114:9000" -ForegroundColor $CYAN
+Write-Host "API文档: http://125.122.32.114:9000/docs" -ForegroundColor $CYAN
 Write-Host ""
 Write-Host "按 Ctrl+C 停止服务" -ForegroundColor $YELLOW
 Write-Host ""

+ 2 - 2
backend-client-bak/start.sh

@@ -44,10 +44,10 @@ echo -e "${GREEN}启动模式:$MODE${NC}"
 
 if [ "$MODE" = "dev" ]; then
     echo -e "${GREEN}启动客户端开发服务器...${NC}"
-    echo -e "${YELLOW}API文档:http://192.168.2.54:9000/docs${NC}"
+    echo -e "${YELLOW}API文档:http://125.122.32.114:9000/docs${NC}"
     uvicorn app.main:app --reload --host 0.0.0.0 --port 9000
 else
     echo -e "${GREEN}启动客户端生产服务器...${NC}"
-    echo -e "${YELLOW}API文档:http://192.168.2.54:9000/docs${NC}"
+    echo -e "${YELLOW}API文档:http://125.122.32.114:9000/docs${NC}"
     uvicorn app.main:app --host 0.0.0.0 --port 9000 --workers 4
 fi

+ 3 - 3
backend-client/app/API日志记录功能使用指南.md

@@ -38,7 +38,7 @@ backend-client/
 ```json
 {
     "timestamp": "2026-02-02 18:30:45.123",  // 时间戳(精确到毫秒)
-    "endpoint": "http://192.168.2.54:9000/api/v1/auth/login",  // 接口路径
+    "endpoint": "http://125.122.32.114:9000/api/v1/auth/login",  // 接口路径
     "method": "POST",                         // HTTP方法
     "user_id": 1,                             // 用户ID(可为null)
     "client_ip": "192.168.1.100",             // 客户端IP
@@ -202,8 +202,8 @@ loguru_logger.add(
 控制台会同时输出简化的日志信息:
 
 ```
-[API请求] POST http://192.168.2.54:9000/api/v1/auth/login - 请求数据(密文): eyJ...
-[API响应] POST http://192.168.2.54:9000/api/v1/auth/login - 响应数据(密文): eyJ... - 执行时间: 105ms
+[API请求] POST http://125.122.32.114:9000/api/v1/auth/login - 请求数据(密文): eyJ...
+[API响应] POST http://125.122.32.114:9000/api/v1/auth/login - 响应数据(密文): eyJ... - 执行时间: 105ms
 ```
 
 ### 3. 文件日志

+ 2 - 2
backend-client/start.sh

@@ -44,10 +44,10 @@ echo -e "${GREEN}启动模式:$MODE${NC}"
 
 if [ "$MODE" = "dev" ]; then
     echo -e "${GREEN}启动客户端开发服务器...${NC}"
-    echo -e "${YELLOW}API文档:http://192.168.2.54:9000/docs${NC}"
+    echo -e "${YELLOW}API文档:http://125.122.32.114:9000/docs${NC}"
     uvicorn app.main:app --reload --host 0.0.0.0 --port 9000
 else
     echo -e "${GREEN}启动客户端生产服务器...${NC}"
-    echo -e "${YELLOW}API文档:http://192.168.2.54:9000/docs${NC}"
+    echo -e "${YELLOW}API文档:http://125.122.32.114:9000/docs${NC}"
     uvicorn app.main:app --host 0.0.0.0 --port 9000 --workers 4
 fi

+ 1 - 1
backend-client/start_prod.sh

@@ -67,5 +67,5 @@ if ! "$PYTHON_BIN" -c "import uvicorn" > /dev/null 2>&1; then
 fi
 
 printf '%b\n' "${GREEN}启动客户端生产服务器...${NC}"
-printf '%b\n' "${YELLOW}API 文档:http://192.168.2.54:9000/docs${NC}"
+printf '%b\n' "${YELLOW}API 文档:http://125.122.32.114:9000/docs${NC}"
 exec "$PYTHON_BIN" -m uvicorn app.main:app --host 0.0.0.0 --port 9000 --workers 4

+ 3 - 3
client-tauri/BUILD-EXE-GUIDE.md

@@ -78,7 +78,7 @@ $env:RUSTFLAGS = "-C target-feature=+crt-static"  # 静态链接 C 运行时库
 . (Join-Path $ProjectRoot "scripts\set-openssl-static-env.ps1")
 
 # 2. 设置 API 地址
-$env:DEFAULT_BACKEND_API_URL = "http://192.168.2.54:9000"
+$env:DEFAULT_BACKEND_API_URL = "http://125.122.32.114:9000"
 
 # 3. 安装前端依赖
 npm install --silent
@@ -96,7 +96,7 @@ $nsisFiles = Get-ChildItem -Path "src-tauri\target\release\bundle\nsis" -Filter
 ```powershell
 # 与 build-release 类似的配置,用于生产环境
 . (Join-Path $PSScriptRoot "scripts\set-openssl-static-env.ps1")
-$env:DEFAULT_BACKEND_API_URL = "http://192.168.2.54:9000"
+$env:DEFAULT_BACKEND_API_URL = "http://125.122.32.114:9000"
 npm run tauri build
 ```
 
@@ -138,7 +138,7 @@ cd client-tauri
 .\build-release.ps1
 
 # 方式三:设置 API 后构建
-$env:DEFAULT_BACKEND_API_URL="http://192.168.2.54:9000"
+$env:DEFAULT_BACKEND_API_URL="http://125.122.32.114:9000"
 npm run tauri:build
 ```
 

+ 1 - 1
client-tauri/BUILD-GUIDE.md

@@ -310,7 +310,7 @@ Set-Location $PSScriptRoot
 # 与 build-prod 一致:静态链接 OpenSSL
 . (Join-Path $PSScriptRoot "scripts\set-openssl-static-env.ps1")
 
-$env:DEFAULT_BACKEND_API_URL = "http://192.168.2.54:9000"
+$env:DEFAULT_BACKEND_API_URL = "http://125.122.32.114:9000"
 
 # 启用 devtools(右键菜单、检查按钮)
 $env:TAURI_DEVTOOLS = "1"

+ 1 - 1
client-tauri/build-devtools.ps1

@@ -54,7 +54,7 @@ Write-Host "OPENSSL_LIB_DIR: $env:OPENSSL_LIB_DIR"
 Write-Host "OPENSSL_STATIC: $env:OPENSSL_STATIC"
 Write-Host "========================================" -ForegroundColor Cyan
 
-$env:DEFAULT_BACKEND_API_URL = "http://192.168.2.54:9000"
+$env:DEFAULT_BACKEND_API_URL = "http://125.122.32.114:9000"
 $env:TAURI_DEVTOOLS = "1"
 
 Write-Host ""

+ 1 - 1
client-tauri/build-prod.ps1

@@ -5,7 +5,7 @@ Set-Location $PSScriptRoot
 # 与 build-release 一致:静态链接 OpenSSL,避免目标机缺少 libcrypto-3-x64.dll
 . (Join-Path $PSScriptRoot "scripts\set-openssl-static-env.ps1")
 
-$env:DEFAULT_BACKEND_API_URL = "http://192.168.2.54:9000"
+$env:DEFAULT_BACKEND_API_URL = "http://125.122.32.114:9000"
 Write-Host "开始打包,API 地址: $env:DEFAULT_BACKEND_API_URL"
 npm run tauri build
 Write-Host "打包完成"

+ 1 - 1
client-tauri/build-release.ps1

@@ -3,7 +3,7 @@
 $ErrorActionPreference = "Stop"
 
 $ProjectRoot = $PSScriptRoot
-$APIUrl = "http://192.168.2.54:9000"
+$APIUrl = "http://125.122.32.114:9000"
 
 # OpenSSL 静态链接(与 .cargo/config.toml +crt-static 一致)
 . (Join-Path $ProjectRoot "scripts\set-openssl-static-env.ps1")

+ 1 - 1
client-tauri/default-config.json

@@ -1,6 +1,6 @@
 {
   "api": {
-    "base_url": "http://192.168.2.54:9000",
+    "base_url": "http://125.122.32.114:9000",
     "timeout": 30,
     "software_code": "buff-xp-steam-sh"
   },

+ 2 - 2
client-tauri/do-build.ps1

@@ -2,7 +2,7 @@ $ErrorActionPreference = "Continue"
 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
 Write-Host "========================================"
 Write-Host "开始打包 client-tauri"
-Write-Host "API 地址: http://192.168.2.54:9000"
+Write-Host "API 地址: http://125.122.32.114:9000"
 Write-Host "========================================"
 
 Set-Location $PSScriptRoot
@@ -15,7 +15,7 @@ try {
     exit 1
 }
 
-$env:DEFAULT_BACKEND_API_URL = "http://192.168.2.54:9000"
+$env:DEFAULT_BACKEND_API_URL = "http://125.122.32.114:9000"
 
 Write-Host "开始执行 npm run tauri build..."
 npm run tauri build

+ 1 - 1
client-tauri/package.json

@@ -13,7 +13,7 @@
     "tauri:build": "tauri build",
     "tauri:build:all": "tauri build --target all",
     "tauri:build:windows": "tauri build",
-    "tauri:build:prod": "set DEFAULT_BACKEND_API_URL=http://192.168.2.54:9000&& tauri build",
+    "tauri:build:prod": "set DEFAULT_BACKEND_API_URL=http://125.122.32.114:9000&& tauri build",
     "build:windows:with-name": "powershell -ExecutionPolicy Bypass -File build-windows.ps1 -RunBuild",
     "postembed": "powershell -ExecutionPolicy Bypass -File src-tauri/post_embed_icon.ps1",
     "tauri:build:windows:with-icon": "npm run tauri:build:windows && npm run postembed && npm run nsis:pack",

+ 1 - 1
client-tauri/src-tauri/src/api_client.rs

@@ -26,7 +26,7 @@ pub struct ApiConfig {
 impl Default for ApiConfig {
     fn default() -> Self {
         ApiConfig {
-            base_url: "http://192.168.2.54:9000".to_string(),
+            base_url: "http://125.122.32.114:9000".to_string(),
             timeout: 30,
             software_code: "buff-xp-steam-sh".to_string(),
         }

+ 17 - 0
client-tauri/src-tauri/src/commands.rs

@@ -5875,6 +5875,23 @@ pub async fn read_local_sweep_success_items(
     serde_json::to_string(&resp).map_err(|e| format!("序列化失败: {}", e))
 }
 
+/// 读取本地扫货成功数据(导出用,无分页限制)
+#[tauri::command]
+pub async fn read_all_local_sweep_success_items() -> Result<String, String> {
+    let all_items = load_all_local_sweep_success_items().unwrap_or_default();
+    let total = all_items.len() as i64;
+
+    let resp = serde_json::json!({
+        "code": 200,
+        "msg": "ok",
+        "data": {
+            "total": total,
+            "items": all_items
+        }
+    });
+    serde_json::to_string(&resp).map_err(|e| format!("序列化失败: {}", e))
+}
+
 /// 添加本地扫货成功数据(供外部调用)
 #[tauri::command]
 pub async fn add_local_sweep_success_item(item_json: String) -> Result<String, String> {

+ 1 - 1
client-tauri/src-tauri/src/commands/api_client.rs

@@ -62,7 +62,7 @@ pub struct SecureApiClient {
 impl Default for ApiClientConfig {
     fn default() -> Self {
         Self {
-            api_url: String::from("http://192.168.2.54:9000"),
+            api_url: String::from("http://125.122.32.114:9000"),
             timeout_seconds: 30,
             timestamp_tolerance_seconds: 300,  // 5分钟容忍范围
         }

+ 3 - 3
client-tauri/src-tauri/src/config.rs

@@ -1,7 +1,7 @@
 use serde::{Deserialize, Serialize};
 use std::fs;
 
-const FALLBACK_BACKEND_API_BASE_URL: &str = "http://192.168.2.54:9000";
+const FALLBACK_BACKEND_API_BASE_URL: &str = "http://125.122.32.114:9000";
 const FALLBACK_STEAM_API_BASE_URL: &str = "http://localhost:5000";
 
 fn normalize_base_url(raw: &str, fallback: &str) -> String {
@@ -77,9 +77,9 @@ impl AppConfig {
             {
                 // 保持 IP 地址形式,只更新端口
                 if config.api.base_url.starts_with("http://127.0.0.1") {
-                    config.api.base_url = "http://192.168.2.54:9000".to_string();
+                    config.api.base_url = "http://125.122.32.114:9000".to_string();
                 } else {
-                    config.api.base_url = "http://192.168.2.54:9000".to_string();
+                    config.api.base_url = "http://125.122.32.114:9000".to_string();
                 }
                 let _ = config.save();
             }

+ 3 - 3
client-tauri/src-tauri/src/error.rs

@@ -58,15 +58,15 @@ pub enum ClientError {
 /// 在生产环境隐藏敏感错误信息,在开发环境显示详细错误
 impl From<ClientError> for String {
     fn from(error: ClientError) -> String {
-        // 生产环境:简化错误信息,保护敏感信息
+        // 生产环境:简化错误信息,但保留后端返回的具体业务错误消息
         if !cfg!(debug_assertions) {
             match error {
                 ClientError::NetworkError { .. } =>
                     "网络连接失败,请检查网络设置".to_string(),
                 ClientError::ServerError { .. } =>
                     "服务器响应异常,请稍后重试".to_string(),
-                ClientError::ApiBusinessError { .. } =>
-                    "操作失败,请稍后重试".to_string(),
+                ClientError::ApiBusinessError { message, .. } =>
+                    message,  // 保留后端返回的具体错误消息
                 ClientError::ClientNotInitialized =>
                     "应用初始化失败,请重启应用".to_string(),
                 ClientError::AntiDebugError { .. } =>

+ 1 - 0
client-tauri/src-tauri/src/main.rs

@@ -272,6 +272,7 @@ fn main() {
             read_sweep_worker_backup_log,
             get_sweep_worker_log_files,
             read_local_sweep_success_items,
+            read_all_local_sweep_success_items,
             read_steam_account_sweep_items,
             add_local_sweep_success_item,
             add_demo_sweep_success_item,

+ 46 - 0
client-tauri/src/utils/secureApiClient.ts

@@ -1747,6 +1747,52 @@ class SecureApiClient {
     }
   }
 
+  /**
+   * 读取本地扫货成功数据(导出用,无分页限制)
+   */
+  async getAllBuffSweepResultLocal(): Promise<ApiResponse<{
+    total: number
+    items: Array<{
+      sweep_request_id: number
+      selection_request_id: number
+      selection_item_id: number
+      goods_id: string
+      goods_name: string
+      icon_url: string
+      wear_range: string
+      purchase_wear: string | null
+      target_price_usd: number | null
+      purchase_price_usd: number | null
+      steam_account?: string | null
+      created_at: string | null
+    }>
+  }>> {
+    try {
+      const raw = await invoke<string>('read_all_local_sweep_success_items', {})
+      const json = JSON.parse(raw) as { code?: number; msg?: string; data?: any }
+      const code = json?.code ?? 200
+      const data = json?.data
+      return {
+        code,
+        msg: this.formatMessageWithCode(code, json?.msg ?? '', 'ok'),
+        data: {
+          total: Number(data?.total ?? 0),
+          items: Array.isArray(data?.items) ? data.items : []
+        }
+      }
+    } catch (error: any) {
+      console.error('[SecureApiClient] 本地读取所有扫货成功数据失败:', error)
+      return {
+        code: 500,
+        msg: error?.message ?? '本地读取所有扫货成功数据失败',
+        data: {
+          total: 0,
+          items: []
+        }
+      }
+    }
+  }
+
   /**
    * 单笔扫货成功明细立即落库(buff_sweep_request_item,append_only)
    * item 字段与后端 sweep-item-client-sync 单条一致:selection_item_id、goods_id、goods_name、icon_url、wear_range、

+ 83 - 64
client-tauri/src/views/BuffSelectionView.vue

@@ -419,7 +419,7 @@
         <div class="section-body table-wrap">
           <a-table
             :columns="filteredSweepColumns"
-            :data-source="paginatedSweepList"
+            :data-source="sweepList"
             :pagination="sweepPagination"
             :loading="sweepTableLoading"
             :row-key="sweepRowKey"
@@ -1117,59 +1117,87 @@ const filteredSweepColumns = computed(() => {
   return sweepColumns.filter(col => col.key !== 'listing_id')
 })
 
-const formatSweepTime = (timestamp: number) => {
-  if (!timestamp) return '—'
-  const date = new Date(timestamp * 1000)
-  return date.toLocaleString('zh-CN', {
-    year: 'numeric',
-    month: '2-digit',
-    day: '2-digit',
-    hour: '2-digit',
-    minute: '2-digit',
-    second: '2-digit',
-    hour12: false
-  })
+const formatSweepTime = (val: unknown) => {
+  if (val == null || val === '') return '—'
+  // 如果是 Unix 时间戳(数字,值较大如 1745000000)
+  if (typeof val === 'number' && val > 1000000000) {
+    const date = new Date(val * 1000)
+    return date.toLocaleString('zh-CN', {
+      year: 'numeric',
+      month: '2-digit',
+      day: '2-digit',
+      hour: '2-digit',
+      minute: '2-digit',
+      second: '2-digit',
+      hour12: false
+    })
+  }
+  // 如果是字符串格式(如 "2026-04-24 10:30:00"),使用 dayjs 解析
+  const d = dayjs(val as string)
+  return d.isValid() ? d.format('YYYY-MM-DD HH:mm:ss') : '—'
 }
 
 const exportSweepTxt = () => {
-  const data = sweepList.value
-  if (data.length === 0) {
-    message.warning('暂无数据可导出')
-    return
-  }
-  const exportData = data.map((item, index) => ({
-    '序号': index + 1,
-    '饰品ID': item.goods_id || '',
-    '饰品名称': item.goods_name || '',
-    '区间': item.wear_range || '',
-    '已购磨损值': item.purchase_wear || '',
-    '目标价格(美元)': item.target_price_usd || '',
-    '成交价格(美元)': item.purchase_price_usd || '',
-    '成交价格(人民币)': item.purchase_price_cny || '',
-    '购买账号': item.steam_account || '',
-    '扫货时间': formatSweepTime(item.created_at)
-  }))
-  const txtContent = JSON.stringify(exportData, null, 2)
-  const blob = new Blob(['\ufeff' + txtContent], { type: 'text/plain;charset=utf-8' })
-  const url = URL.createObjectURL(blob)
-  const link = document.createElement('a')
-  link.href = url
-  link.download = `扫货成功数据_${new Date().toISOString().slice(0, 10)}.txt`
-  link.click()
-  URL.revokeObjectURL(url)
-  message.success(`已导出 ${data.length} 条数据`)
+  exportingSweepExcel.value = true
+  // 一次性加载所有数据,不受检索条件影响
+  secureApiClient.getAllBuffSweepResultLocal().then(res => {
+    exportingSweepExcel.value = false
+    if (res.code !== 200 || !res.data) {
+      message.error('加载数据失败')
+      return
+    }
+    const data = Array.isArray(res.data.items) ? res.data.items : []
+    if (data.length === 0) {
+      message.warning('暂无数据可导出')
+      return
+    }
+    // 按时间倒序
+    data.sort((a: any, b: any) => parseLogTimestamp(b?.created_at) - parseLogTimestamp(a?.created_at))
+    const exportData = data.map((item: any, index: number) => ({
+      '序号': index + 1,
+      '饰品ID': item.goods_id || '',
+      '饰品名称': item.goods_name || '',
+      '区间': item.wear_range || '',
+      '已购磨损值': item.purchase_wear || '',
+      '目标价格(美元)': item.target_price_usd || '',
+      '成交价格(美元)': item.purchase_price_usd || '',
+      '成交价格(人民币)': item.purchase_price_cny || '',
+      '购买账号': item.steam_account || '',
+      '扫货时间': formatSweepTime(item.created_at)
+    }))
+    const txtContent = JSON.stringify(exportData, null, 2)
+    const blob = new Blob(['\ufeff' + txtContent], { type: 'text/plain;charset=utf-8' })
+    const url = URL.createObjectURL(blob)
+    const link = document.createElement('a')
+    link.href = url
+    link.download = `扫货成功数据_${new Date().toISOString().slice(0, 10)}.txt`
+    link.click()
+    URL.revokeObjectURL(url)
+    message.success(`已导出 ${data.length} 条数据`)
+  }).catch(() => {
+    exportingSweepExcel.value = false
+    message.error('导出失败')
+  })
 }
 
 const exportSweepExcel = async () => {
-  const data = sweepList.value
-  if (data.length === 0) {
-    message.warning('暂无数据可导出')
-    return
-  }
   exportingSweepExcel.value = true
   try {
+    // 一次性加载所有数据,不受检索条件影响
+    const res = await secureApiClient.getAllBuffSweepResultLocal()
+    if (res.code !== 200 || !res.data) {
+      message.error('加载数据失败')
+      return
+    }
+    let data = Array.isArray(res.data.items) ? res.data.items : []
+    if (data.length === 0) {
+      message.warning('暂无数据可导出')
+      return
+    }
+    // 按时间倒序
+    data.sort((a: any, b: any) => parseLogTimestamp(b?.created_at) - parseLogTimestamp(a?.created_at))
     const XLSX = await import('xlsx')
-    const exportData = data.map((item, index) => ({
+    const exportData = data.map((item: any, index: number) => ({
       '序号': index + 1,
       '饰品ID': item.goods_id || '',
       '饰品名称': item.goods_name || '',
@@ -1518,7 +1546,7 @@ const tablePagination = reactive({
 const sweepPagination = reactive({
   current: 1,
   pageSize: 10,
-  total: computed(() => filteredSweepList.value.length),
+  total: 0,
   showSizeChanger: true,
   showTotal: (total: number) => `共 ${total} 条`,
   simple: false,
@@ -2812,27 +2840,14 @@ async function fetchSweepResult(showLoading = false): Promise<string | null> {
     sweepTableLoading.value = true
   }
   try {
+    // 后端分页加载
     const res = await secureApiClient.getBuffSweepResultLocal(
       sweepPagination.current,
       sweepPagination.pageSize
     )
     if (res.code === 200 && res.data) {
-      const nextItemsRaw = Array.isArray(res.data.items) ? res.data.items : []
-      const nextItems = [...nextItemsRaw].sort((a: any, b: any) => {
-        // 主要排序:按 created_at 时间倒序(最新在前)
-        const byTime = parseLogTimestamp(b?.created_at) - parseLogTimestamp(a?.created_at)
-        if (byTime !== 0) return byTime
-        // 次要排序:按 listing_id 倒序(字符串比较,保持顺序一致性)
-        const idA = a?.listing_id ?? ''
-        const idB = b?.listing_id ?? ''
-        return idB.localeCompare(idA)
-      })
-      // 与选品列表一致:每次拉取后整体替换,轮询时 showLoading=false,表格无整表 loading 闪烁。
-      // 限制数组大小,防止内存泄漏
-      const MAX_SWEEP_ITEMS = 2000
-      sweepList.value = nextItems.length > MAX_SWEEP_ITEMS
-        ? nextItems.slice(-MAX_SWEEP_ITEMS)
-        : nextItems
+      const items = Array.isArray(res.data.items) ? res.data.items : []
+      sweepList.value = items
       sweepPagination.total = res.data.total || 0
       // 本地数据没有 status,返回 null 让轮询继续
       return null
@@ -2906,8 +2921,12 @@ function startSweepPoll(showFinishMessage = false) {
 }
 
 function onSweepTableChange(pagination: any) {
-  sweepPagination.current = pagination?.current || 1
-  sweepPagination.pageSize = pagination?.pageSize || 10
+  const newPage = pagination?.current || 1
+  const newPageSize = pagination?.pageSize || 10
+  sweepPagination.current = newPage
+  sweepPagination.pageSize = newPageSize
+  // 翻页时重新请求后端数据
+  fetchSweepResult(false)
 }
 
 /** 判断是否为网络相关错误(需要重试) */

+ 3 - 3
client-tauri/src/views/SettingsView.vue

@@ -20,7 +20,7 @@
             placeholder="请输入API服务器地址"
             :disabled="saving"
           />
-          <div class="form-hint">例如: http://192.168.2.54:9000</div>
+          <div class="form-hint">例如: http://125.122.32.114:9000</div>
         </div>
 
         <div class="form-group">
@@ -176,7 +176,7 @@ const updateTitle = ref('')
 
 // API设置
 const apiSettings = reactive({
-  baseUrl: 'http://192.168.2.54:9000',
+  baseUrl: 'http://125.122.32.114:9000',
   softwareCode: 'buff-xp-steam-sh',
   timeout: 30
 })
@@ -223,7 +223,7 @@ async function saveSettings() {
 
 // 重置设置
 function resetSettings() {
-  apiSettings.baseUrl = 'http://192.168.2.54:9000'
+  apiSettings.baseUrl = 'http://125.122.32.114:9000'
   apiSettings.softwareCode = 'buff-xp-steam-sh'
   apiSettings.timeout = 30
   securitySettings.autoRenewSession = true

+ 1 - 1
client-tauri/standalone-build.ps1

@@ -9,7 +9,7 @@ Write-Host "========================================" -ForegroundColor Cyan
 Write-Host "`n[1/4] Setting OpenSSL static build environment..." -ForegroundColor Yellow
 . (Join-Path $PSScriptRoot "scripts\set-openssl-static-env.ps1")
 
-$env:DEFAULT_BACKEND_API_URL = "http://192.168.2.54:9000"
+$env:DEFAULT_BACKEND_API_URL = "http://125.122.32.114:9000"
 Write-Host "API URL: $env:DEFAULT_BACKEND_API_URL" -ForegroundColor Cyan
 
 $env:RUSTFLAGS = "-C target-feature=+crt-static"