feat(platform): prevent unscoped raw field lookups

This commit is contained in:
lingniu
2026-07-04 12:53:07 +08:00
parent 34116142e6
commit 89ddb82f46
3 changed files with 73 additions and 2 deletions

View File

@@ -189,10 +189,13 @@ export default function App() {
};
const updateHistoryFilters = (filters: Record<string, unknown> = {}, tab = historyTab) => {
const hasKeywordInput = Object.prototype.hasOwnProperty.call(filters, 'keyword');
const nextFilters = normalizeHistoryFilterValues(filters);
setHistoryFilters(nextFilters);
if (nextFilters.keyword) {
setAnalysisVin(nextFilters.keyword);
} else if (hasKeywordInput) {
setAnalysisVin('');
}
setActiveProtocol(nextFilters.protocol ?? '');
setHistoryTab(tab);
@@ -201,7 +204,7 @@ export default function App() {
if (tab && tab !== 'location') {
routeFilters.tab = tab;
}
replaceHash('history', keyword ?? analysisVin, protocol, routeFilters);
replaceHash('history', hasKeywordInput ? keyword : (keyword ?? analysisVin), protocol, routeFilters);
};
const replaceHistoryHash = (filters: Record<string, string> = {}, tab = historyTab) => {