Skip to content

Commit

Permalink
返回 false 和 CONFLICT
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Dec 2, 2024
1 parent 30a3a9c commit 2287913
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.ghostchu.peerbanhelper.web.Role;
import com.ghostchu.peerbanhelper.web.wrapper.StdResp;
import io.javalin.http.Context;
import io.javalin.http.HttpStatus;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
Expand Down Expand Up @@ -53,7 +54,8 @@ public void onEnable() {

private void handleLicenseRenew(@NotNull Context ctx) throws Exception {
if (activationManager.isActivated()) {
ctx.json(new StdResp(true, tl(locale(ctx), Lang.FREE_LICENSE_RENEW_STILL_ACTIVE), null));
ctx.status(HttpStatus.CONFLICT);
ctx.json(new StdResp(false, tl(locale(ctx), Lang.FREE_LICENSE_RENEW_STILL_ACTIVE), null));
return;
}
var newLocalLicense = activationKeyManager.generateLocalLicense();
Expand Down

0 comments on commit 2287913

Please sign in to comment.