fix(operator): fix operator edit issue
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m51s

This commit is contained in:
sexygoat
2026-04-10 14:00:21 +08:00
parent 9a6f085cde
commit 2b3119c549
53 changed files with 547 additions and 418 deletions

View File

@@ -6,7 +6,7 @@
import { ref } from 'vue'
import { ElMessage } from 'element-plus'
import { AssetService } from '@/api/modules'
import type { AssetWalletResponse } from '@/types/api'
import type { AssetWalletResponse, DeviceGatewayInfo, AssetPackageUsageRecord } from '@/types/api'
/**
* 格式化数据大小(MB -> GB/MB)
@@ -22,11 +22,11 @@ export function useAssetInfo() {
// 状态管理
const loading = ref(false)
const cardInfo = ref<any>(null) // 使用 any 以保持与原始实现一致
const deviceRealtime = ref<DeviceRealtimeInfo | null>(null)
const currentPackage = ref<PackageInfo | null>(null)
const deviceRealtime = ref<DeviceGatewayInfo | null>(null)
const currentPackage = ref<AssetPackageUsageRecord | null>(null)
const currentPackageLoading = ref(false)
const currentPackageErrorMsg = ref('')
const packageList = ref<PackageInfo[]>([])
const packageList = ref<AssetPackageUsageRecord[]>([])
const walletInfo = ref<AssetWalletResponse | null>(null)
const walletLoading = ref(false)
@@ -111,7 +111,7 @@ export function useAssetInfo() {
const assetIdentifier = data.asset_type === 'card' ? data.iccid : data.virtual_no
if (assetIdentifier) {
// 并行调用多个接口: 当前生效套餐、套餐列表、实时状态、钱包概况
Promise.all([
await Promise.all([
loadCurrentPackage(assetIdentifier),
loadPackageList(assetIdentifier),
loadRealtimeStatus(assetIdentifier, data.asset_type),
@@ -319,11 +319,9 @@ export function useAssetInfo() {
await loadRealtimeStatus(identifier, assetType)
}
} catch (error: any) {
// 检查429错误(冷却期)
// 检查 429 错误(冷却期)
if (error?.response?.status === 429) {
ElMessage.warning('刷新过于频繁,请稍后再试')
} else {
ElMessage.error(error?.message || '刷新失败')
}
throw error
}