api测试

pull/79/head^2
zhangchenhao 2025-05-09 10:35:21 +08:00
parent 366904cc31
commit e4265f5ddc
1 changed files with 4 additions and 0 deletions

View File

@ -134,6 +134,10 @@ func checkApiKey(c *gin.Context) bool {
return false
}
apiKey := public.GetSettingIgnoreError("api_key")
if apiKey == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "未开启api"})
return false
}
// timestamp := time.Now().Unix()
ApiToken := generateSignature(form.Timestamp, apiKey)
if form.ApiToken != ApiToken {