fix(cr2-frontend): 代理归属回退、换号继承确认与请求竞态收口
- CR-04:全局代理加 proxy_uid 归属,跨账号不再静默回退/补报 - CR-12:取消静默继承,设置页显式确认;同 OS 作用域、locked 代理排除、无效快照清除、uid+epoch 双校验、登出 capture 超时 - CR-26/27:关键词分页初始值与档位一致;两页面请求序号闸丢弃旧响应 vue-tsc 两前端 rc=0;定向 35 + 8 + 2 例全绿。
This commit is contained in:
@@ -10,6 +10,7 @@ import { showAdminFeedback } from '@/components/admin-feedback-ui'
|
||||
import { openAdminConfirm } from '@/components/admin-confirm'
|
||||
import OldPagination from '@/components/OldPagination.vue'
|
||||
import LoadFailureBar from '@/components/LoadFailureBar.vue'
|
||||
import { createLatestRequestGate } from '@/utils/latest-request'
|
||||
import {
|
||||
GATING_COUNTRIES,
|
||||
GATING_SOURCES,
|
||||
@@ -50,6 +51,10 @@ const batchText = ref('')
|
||||
const importBusy = ref(false)
|
||||
const busyRowId = ref(0)
|
||||
|
||||
// 快速改筛选/翻页时先发的请求可能后返回;列表与统计各一个序号闸(CR-27)
|
||||
const pageGate = createLatestRequestGate()
|
||||
const statsGate = createLatestRequestGate()
|
||||
|
||||
const countryOptions = GATING_COUNTRIES.filter((country) => country !== '全部')
|
||||
const typeOptions = GATING_TYPES
|
||||
|
||||
@@ -72,30 +77,37 @@ function feedback(message: string, kind: AdminFeedbackKind): void {
|
||||
}
|
||||
|
||||
async function loadStats(): Promise<void> {
|
||||
const token = statsGate.begin()
|
||||
statsLoading.value = true
|
||||
statsError.value = ''
|
||||
try {
|
||||
stats.value = await fetchBrandGatingStats()
|
||||
const result = await fetchBrandGatingStats()
|
||||
if (!statsGate.isCurrent(token)) return
|
||||
stats.value = result
|
||||
} catch (error) {
|
||||
if (!statsGate.isCurrent(token)) return
|
||||
statsError.value = actionableErrorText(error)
|
||||
} finally {
|
||||
statsLoading.value = false
|
||||
if (statsGate.isCurrent(token)) statsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function loadPage(nextPage = page.value): Promise<void> {
|
||||
const token = pageGate.begin()
|
||||
pageLoading.value = true
|
||||
loadError.value = ''
|
||||
try {
|
||||
const result = await fetchBrandGatingPage(filter, nextPage, pageSize.value)
|
||||
if (!pageGate.isCurrent(token)) return
|
||||
rows.value = result.rows
|
||||
total.value = result.total
|
||||
page.value = nextPage
|
||||
loaded.value = true
|
||||
} catch (error) {
|
||||
if (!pageGate.isCurrent(token)) return
|
||||
loadError.value = actionableErrorText(error)
|
||||
} finally {
|
||||
pageLoading.value = false
|
||||
if (pageGate.isCurrent(token)) pageLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user