Skip to content

Commit

Permalink
fix(core): some logic
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed May 18, 2024
1 parent 1ce393c commit 13cf9b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/core/src/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ export async function launch() {
continue
}

if (!isMatchBase(url, `${moduleItem.base}/${key}`))
const base = typeof moduleItem.base === 'string' ? moduleItem.base : moduleItem.base.find(item => isMatchBase(url, item, false))
console.log(`[activator] ${url} | ${base} | ${key}`)
if (!isMatchBase(url, `${base}/${key}`))
continue

// 如果配置是函数,这个时候其实就没有什么特殊情况了,所以直接执行
Expand Down
11 changes: 8 additions & 3 deletions packages/modules/lemon-squeezy/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ export function generateLemonSqueezyShare(licenseKey: string) {

export function getLemonSqueezyLicenseKeyFromRequest() {
const body = destr($request.body) as {
license_key: string
license_key?: string
licenseKey?: string
} | undefined
const license_key = body?.license_key || (parseURL($request.url).params as { license_key: string }).license_key
return license_key
// const license_key = body?.license_key || (parseURL($request.url).params as { license_key: string }).license_key
const license_key = body?.license_key
|| body?.licenseKey
|| (parseURL($request.url).params as { license_key?: string, licenseKey?: string }).license_key
|| (parseURL($request.url).params as { license_key?: string, licenseKey?: string }).licenseKey
return license_key || ''
}

0 comments on commit 13cf9b4

Please sign in to comment.