api测试

pull/79/head^2
zhangchenhao 2025-05-09 10:39:55 +08:00
parent e4265f5ddc
commit 79ec33b33e
2 changed files with 11 additions and 8 deletions

View File

@ -133,6 +133,9 @@ func checkApiKey(c *gin.Context) bool {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid request"})
return false
}
if form.ApiToken == "" || form.Timestamp == "" {
return false
}
apiKey := public.GetSettingIgnoreError("api_key")
if apiKey == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "未开启api"})