mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-01 12:06:38 +08:00
fix: enforce license-backed user capacity
This commit is contained in:
@@ -33,13 +33,6 @@ export interface LicenseStatus {
|
||||
message?: string
|
||||
}
|
||||
|
||||
/** Generate a short device fingerprint from browser/OS info. */
|
||||
function deviceFingerprint(): string {
|
||||
const nav = window.navigator
|
||||
const parts = [nav.hardwareConcurrency, nav.language, screen.width, screen.height]
|
||||
return btoa(parts.join('|')).slice(0, 32).replace(/[+/=]/g, '')
|
||||
}
|
||||
|
||||
// ── API methods ──
|
||||
|
||||
export const licenseAPI = {
|
||||
@@ -48,8 +41,6 @@ export const licenseAPI = {
|
||||
api
|
||||
.post<LicenseActivation>('/license/activate', {
|
||||
key: key.trim(),
|
||||
device_id: deviceFingerprint(),
|
||||
device_name: navigator.platform || 'Web Client',
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ export function LicenseHeader() {
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="font-display text-3xl font-bold text-ink-600">许可证</h1>
|
||||
<p className="text-sm text-ink-50">绑定授权密钥以解锁全部功能</p>
|
||||
<p className="text-sm text-ink-50">绑定授权密钥以提升多用户容量</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
@@ -55,7 +55,7 @@ export function LicenseBindPanel({
|
||||
</button>
|
||||
</form>
|
||||
<p className="text-xs text-sand-500">
|
||||
输入从授权服务器获取的许可证密钥,激活后即可使用所有高级功能。
|
||||
输入从授权服务器获取的许可证密钥,激活后按授权额度开放更多平台用户。
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
@@ -126,7 +126,7 @@ export function LicenseStatusPanel({
|
||||
|
||||
{active && activation && (
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<StatusBadge label="密钥" value={activation.key ?? activation.key_id} mono />
|
||||
<StatusBadge label="密钥" value={activation.key || activation.key_id} mono />
|
||||
<StatusBadge
|
||||
label="套餐"
|
||||
value={activation.plan ?? 'standard'}
|
||||
|
||||
@@ -122,7 +122,7 @@ export const licenseSettingsGroup: SettingGroup = {
|
||||
key: 'license.hmac_secret',
|
||||
label: 'HMAC 签名密钥',
|
||||
type: 'text',
|
||||
hint: '必须与 License Server 的 LICENSE_HMAC_SECRET 保持一致;留空则跳过响应签名校验。',
|
||||
hint: '必须与 License Server 的 LICENSE_HMAC_SECRET 保持一致;用于校验多用户授权响应签名。',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user