mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-18 09:16:39 +08:00
fix: deauthorize some apis
This commit is contained in:
parent
1a6afcd266
commit
4faee3e48e
@ -175,8 +175,8 @@ func authorizeMiddleware(s *AppServer) gin.HandlerFunc {
|
|||||||
if c.Request.URL.Path == "/api/user/login" ||
|
if c.Request.URL.Path == "/api/user/login" ||
|
||||||
c.Request.URL.Path == "/api/admin/login" ||
|
c.Request.URL.Path == "/api/admin/login" ||
|
||||||
c.Request.URL.Path == "/api/user/register" ||
|
c.Request.URL.Path == "/api/user/register" ||
|
||||||
c.Request.URL.Path == "/api/sms/status" ||
|
strings.HasPrefix(c.Request.URL.Path, "/api/sms/") ||
|
||||||
strings.HasPrefix(c.Request.URL.Path, "/api/verify/") ||
|
strings.HasPrefix(c.Request.URL.Path, "/api/captcha/") ||
|
||||||
strings.HasPrefix(c.Request.URL.Path, "/static/") ||
|
strings.HasPrefix(c.Request.URL.Path, "/static/") ||
|
||||||
c.Request.URL.Path == "/api/admin/config/get" {
|
c.Request.URL.Path == "/api/admin/config/get" {
|
||||||
c.Next()
|
c.Next()
|
||||||
|
@ -25,8 +25,8 @@ func NewSmsHandler(app *core.AppServer, db *store.LevelDB, sms *service.AliYunSm
|
|||||||
return handler
|
return handler
|
||||||
}
|
}
|
||||||
|
|
||||||
// VerifyCode 发送验证码短信
|
// SendCode 发送验证码短信
|
||||||
func (h *SmsHandler) VerifyCode(c *gin.Context) {
|
func (h *SmsHandler) SendCode(c *gin.Context) {
|
||||||
var data struct {
|
var data struct {
|
||||||
Mobile string `json:"mobile"`
|
Mobile string `json:"mobile"`
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
|
@ -181,7 +181,7 @@ func main() {
|
|||||||
fx.Invoke(func(s *core.AppServer, h *handler.SmsHandler) {
|
fx.Invoke(func(s *core.AppServer, h *handler.SmsHandler) {
|
||||||
group := s.Engine.Group("/api/sms/")
|
group := s.Engine.Group("/api/sms/")
|
||||||
group.GET("status", h.Status)
|
group.GET("status", h.Status)
|
||||||
group.POST("code", h.VerifyCode)
|
group.POST("code", h.SendCode)
|
||||||
}),
|
}),
|
||||||
fx.Invoke(func(s *core.AppServer, h *handler.CaptchaHandler) {
|
fx.Invoke(func(s *core.AppServer, h *handler.CaptchaHandler) {
|
||||||
group := s.Engine.Group("/api/captcha/")
|
group := s.Engine.Group("/api/captcha/")
|
||||||
|
Loading…
Reference in New Issue
Block a user