|
|
@@ -74,15 +74,19 @@ func sysBaseRouter(r *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
|
|
|
r.GET("/", apis.Admin)
|
|
|
}
|
|
|
r.GET("/info", handler.Ping)
|
|
|
- v1 := r.Group("/api/")
|
|
|
+ r1 := r.Group("/api/")
|
|
|
{
|
|
|
- v1.POST("/login", authMiddleware.LoginHandler)
|
|
|
+ r1.POST("/login", authMiddleware.LoginHandler)
|
|
|
// Refresh time can be longer than token timeout
|
|
|
- v1.GET("/refresh-token", authMiddleware.RefreshHandler)
|
|
|
- v1.POST("/logout", handler.LogOut)
|
|
|
+ r1.GET("/refresh-token", authMiddleware.RefreshHandler)
|
|
|
// 验证码
|
|
|
- v1.GET("/captcha", (&apis.SystemApi{}).GenerateCaptchaHandler)
|
|
|
+ r1.GET("/captcha", (&apis.SystemApi{}).GenerateCaptchaHandler)
|
|
|
}
|
|
|
+ r2 := r.Group("/api/").Use(authMiddleware.MiddlewareFunc())
|
|
|
+ {
|
|
|
+ r2.POST("/logout", handler.LogOut)
|
|
|
+ }
|
|
|
+
|
|
|
wss := r.Group("").Use(authMiddleware.MiddlewareFunc())
|
|
|
{
|
|
|
wss.GET("/ws/:id/:channel", ws.WebsocketManager.WsClient)
|