fix: 手动触发
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m15s

This commit is contained in:
sexygoat
2026-04-28 11:14:13 +08:00
parent b88f2d185e
commit fb10b72760
9 changed files with 462 additions and 205 deletions

View File

@@ -276,6 +276,9 @@ export function useAssetInfo() {
if (data.current_month_usage_mb !== undefined) {
cardInfo.value.current_month_usage_mb = data.current_month_usage_mb
}
if (data.last_gateway_reading_mb !== undefined) {
cardInfo.value.last_gateway_reading_mb = data.last_gateway_reading_mb
}
} else if (assetType === 'device') {
// 设备的实时状态
if (data.device_protect_status !== undefined) {
@@ -353,8 +356,9 @@ export function useAssetInfo() {
* 刷新资产数据(调用refresh接口后重新加载)
* @param identifier - 资产标识符
* @param assetType - 资产类型(card/device)
* @returns true if refresh was successful, false if rate limited (429)
*/
const refreshAsset = async (identifier: string, assetType: string) => {
const refreshAsset = async (identifier: string, assetType: string): Promise<boolean> => {
try {
await AssetService.refreshAsset(identifier)
ElMessage.success('刷新成功')
@@ -363,8 +367,15 @@ export function useAssetInfo() {
if (identifier) {
await loadRealtimeStatus(identifier, assetType)
}
return true
} catch (error: any) {
console.log(error)
// Check if it's a 429 rate limit error
if (error?.response?.status === 429) {
ElMessage.warning('操作过于频繁请30秒后再试')
return false
}
return false
}
}