[优化] POW 系统接口方案

This commit is contained in:
ryan
2026-06-06 12:21:55 +08:00
parent 6bf5023af1
commit 123140b762
4 changed files with 15 additions and 5 deletions
+8 -2
View File
@@ -11,7 +11,10 @@ import (
// GetCapChallenge generates a new CAPTCHA challenge
func GetCapChallenge(c *gin.Context) {
scope := c.Query("scope")
scope := c.Param("scope")
if scope == "" {
scope = c.Query("scope")
}
resp, err := service.CapManager.Generate(scope)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{
@@ -25,7 +28,10 @@ func GetCapChallenge(c *gin.Context) {
// RedeemCapChallenge validates CAPTCHA solutions and yields a one-time redeem token
func RedeemCapChallenge(c *gin.Context) {
scope := c.Query("scope")
scope := c.Param("scope")
if scope == "" {
scope = c.Query("scope")
}
var req cap.RedeemRequest
if !bind.JSON(c, &req) {