mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 23:26:38 +08:00
[优化] POW 系统接口方案
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user