feat(license): 退出授权 / 释放本实例(确认后 deactivate)
设置→授权 Pro 态管理员可退出:在线 LIC- 先调 opsx deactivate(含 activation_token),成功才清本地;失败保留现状。LICOFF- 仅解本机并提示后台名额可能仍占。禁静默清码。
This commit is contained in:
1 parent
f3d27ceb04
commit
cec7c6eeaf
10 files changed
+338
-3
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user