feat(license): 退出授权 / 释放本实例(确认后 deactivate)

设置→授权 Pro 态管理员可退出:在线 LIC- 先调 opsx deactivate(含 activation_token),成功才清本地;失败保留现状。LICOFF- 仅解本机并提示后台名额可能仍占。禁静默清码。
This commit is contained in:
opsx committed 2026-11-01 03:16:05 +08:00
1 parent f3d27ceb04
commit cec7c6eeaf
10 files changed
+338 -3

No files matched your search

+22
View File
@@ -331,3 +331,25 @@ func remoteHeartbeatLicence(licenseKey, deviceID string) error {
}
return nil
}
func remoteDeactivateLicence(licenseKey, deviceID, activationToken string) error {
body := map[string]string{
"license_key": licenseKey,
"device_id": deviceID,
}
if strings.TrimSpace(activationToken) != "" {
body["activation_token"] = strings.TrimSpace(activationToken)
}
env, err := postLicenceJSON("/v1/license/deactivate", body)
if err != nil {
return err
}
if envelopeCode(env) != 0 {
msg := envelopeMessage(env)
if msg == "" {
msg = "解绑失败"
}
return fmt.Errorf("%s", msg)
}
return nil
}