From dc4a7e86c48a06b3f22c7cb95528e4ca666b121b Mon Sep 17 00:00:00 2001 From: wangyantong <51265903115@stu.ecnu.edu.cn> Date: Mon, 18 Nov 2024 21:26:33 +0800 Subject: [PATCH] fix: fix the method of obtaining developer names (#925) --- src/helpers/get-developer-info.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/helpers/get-developer-info.ts b/src/helpers/get-developer-info.ts index 271bdf41..853fe05a 100644 --- a/src/helpers/get-developer-info.ts +++ b/src/helpers/get-developer-info.ts @@ -16,7 +16,11 @@ export function getDeveloperNameByPage() { return $('.p-nickname.vcard-username.d-block').text().trim().split(' ')[0]; } export function getDeveloperNameByUrl() { - return pageDetect.utils.getUsername()!; + const currentUrl = window.location.href; + const parsedUrl = new URL(currentUrl); + const pathParts = parsedUrl.pathname.split('/'); + const developerName = pathParts[pathParts.length - 1]; + return developerName; } export async function isDeveloperWithMeta() {