fix(platform-detector): 扩展天翼云盘首页路径识别范围

当访问天翼云盘首页(`/web/main/`)时,返回 `esurfing` 平台标识
这个提交包含在:
Zain 2026-08-15 09:03:55 +08:00
父节点 cefc989c20
当前提交 7d2f92b564
共有 2 个文件被更改,包括 9 次插入 和 1 次删除

查看文件

@ -115,7 +115,7 @@ export function detectPlatformFromUrl(url: string, pathname?: string): PlatformN
// 天翼云盘
if (url.includes('cloud.189.cn')) {
const pathToCheck = pathname ?? extractPathnameFromUrl(url);
return pathToCheck.startsWith('/web/main/file') ? 'esurfing' : null;
return pathToCheck === '/web/main' || pathToCheck === '/web/main/' || pathToCheck.startsWith('/web/main/file') ? 'esurfing' : null;
}
// UC网盘

查看文件

@ -242,6 +242,14 @@ describe('Platform Detection - Unified Utils', () => {
expect(result).toBe('cmcc');
});
it('should detect Esurfing Drive entry page before navigating into file lists', () => {
const result = detectPlatformFromUrl(
'https://cloud.189.cn/web/main/',
'/web/main/'
);
expect(result).toBe('esurfing');
});
it('should detect Esurfing Drive', () => {
const result = detectPlatformFromUrl(
'https://cloud.189.cn/web/main/file/folder/folder189',