feat(license): show Instance ID with copy on settings + ProGate
Always return machine fingerprint instanceId from license status for offline LICOFF- binding. Shared InstanceIdRow (zh/en) above activate.
This commit is contained in:
1 parent
db92426973
commit
f3d27ceb04
6 files changed
+86
-22
No files matched your search
@@ -306,14 +306,17 @@ func deriveInvalidReason(lic *models.License) string {
|
||||
|
||||
// LicenseStatusPayload 给前端:始终带回库存证的 sanitized + 是否有效 Pro。
|
||||
// 无效时带 invalidReason(expired|over_instance|revoked),且不清 LicenseKey。
|
||||
// instanceId 始终返回本机指纹(DATA_DIR/instance.id),供离线 LICOFF- 绑码展示。
|
||||
func LicenseStatusPayload() (map[string]interface{}, bool) {
|
||||
RefreshOpsxLicenseIfDue()
|
||||
current := CurrentLicense()
|
||||
stored := StoredLicense()
|
||||
instanceID := GetOrCreateInstanceID()
|
||||
if stored == nil {
|
||||
return map[string]interface{}{"plan": "free"}, false
|
||||
return map[string]interface{}{"plan": "free", "instanceId": instanceID}, false
|
||||
}
|
||||
out := stored.Sanitized()
|
||||
out["instanceId"] = instanceID
|
||||
if current != nil {
|
||||
delete(out, "invalidReason")
|
||||
return out, true
|
||||
|
||||
Reference in new issue
Block a user