This commit is contained in:
@@ -28,3 +28,27 @@ export function resolveRuntimeNotFoundRecoveryAction(
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 中文注释:公开作品详情页和运行态深链都可能在作品被删除或下架后失效。
|
||||
* 这类入口没有上一层可回退的详情数据,确认提示后统一回首页,避免空详情页白屏。
|
||||
*/
|
||||
export function resolveWorkNotFoundRecoveryAction(
|
||||
pathname: string,
|
||||
): RuntimeNotFoundRecoveryAction | null {
|
||||
const normalizedPath = pathname.trim().toLowerCase().replace(/\/+$/u, '');
|
||||
|
||||
if (
|
||||
normalizedPath === '/works/detail' ||
|
||||
normalizedPath === '/gallery/puzzle/detail' ||
|
||||
normalizedPath === '/gallery/visual-novel/detail'
|
||||
) {
|
||||
return {
|
||||
nextStage: 'platform',
|
||||
nextPath: '/',
|
||||
shouldAlert: true,
|
||||
};
|
||||
}
|
||||
|
||||
return resolveRuntimeNotFoundRecoveryAction(pathname);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user