You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/api/init.go

26 lines
532 B
Go

11 months ago
//
// Copyright (C) 2024 veypi <i@veypi.com>
// 2025-03-04 16:08:06
// Distributed under terms of the MIT license.
//
// Auto generated by OneBD. DO NOT EDIT
package api
import (
3 weeks ago
"github.com/veypi/vigo"
"github.com/veypi/vigo/contrib/common"
11 months ago
)
var Router = vigo.NewRouter()
11 months ago
func init() {
// 注册全局中间件
Router.After(common.JsonResponse, common.JsonErrorResponse)
// 404 处理
Router.Any("/**", vigo.SkipBefore, "拦截未注册的api请求返回404", func(x *vigo.X) error {
return vigo.ErrNotFound
})
}