Skip to content

Commit

Permalink
fix: fix the method of obtaining developer names (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyantong2000 authored Nov 18, 2024
1 parent c47073c commit dc4a7e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/helpers/get-developer-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit dc4a7e8

Please sign in to comment.