镜像自地址
https://github.com/lhly/cloud-drive-renamer.git
已同步 2026-10-20 05:37:47 +08:00
fix(platform-detector): 扩展天翼云盘首页路径识别范围
当访问天翼云盘首页(`/web/main/`)时,返回 `esurfing` 平台标识
这个提交包含在:
父节点
cefc989c20
当前提交
7d2f92b564
@ -115,7 +115,7 @@ export function detectPlatformFromUrl(url: string, pathname?: string): PlatformN
|
|||||||
// 天翼云盘
|
// 天翼云盘
|
||||||
if (url.includes('cloud.189.cn')) {
|
if (url.includes('cloud.189.cn')) {
|
||||||
const pathToCheck = pathname ?? extractPathnameFromUrl(url);
|
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网盘
|
// UC网盘
|
||||||
|
|||||||
@ -242,6 +242,14 @@ describe('Platform Detection - Unified Utils', () => {
|
|||||||
expect(result).toBe('cmcc');
|
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', () => {
|
it('should detect Esurfing Drive', () => {
|
||||||
const result = detectPlatformFromUrl(
|
const result = detectPlatformFromUrl(
|
||||||
'https://cloud.189.cn/web/main/file/folder/folder189',
|
'https://cloud.189.cn/web/main/file/folder/folder189',
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户